Skip to main content

Dead-simple AI training

Project description

neurologic Dead-simple AI training. Build and train neural networks in 3 lines of Python.

Python from neurologic import Model, Trainer

model = Model.classifier(784, [128, 64], 10) trainer = Trainer(model) trainer.fit(X_train, y_train, epochs=10) Install Bash pip install neurologic Quick Start Tabular / CSV Data

Python from neurologic import Model, Trainer, load_csv

X, y = load_csv("data.csv", target="label")

model = Model.classifier(4, [64, 32], 3) trainer = Trainer(model)

trainer.fit(X, y, epochs=20) trainer.save("my_model.pt") Production Inference

For deploying to production, use the lightweight Inference class. It loads the model and handles tensor conversion automatically.

Python from neurologic import Inference

Load and predict in 2 lines

engine = Inference("my_model.pt") prediction = engine.run([0.5, 1.2, 3.3]) Data Loaders Python from neurologic import load_csv, load_images, load_text

CSV -> Tensors

X, y = load_csv("data.csv", target="label")

Images -> Tensors (auto-resizes and normalizes)

images, labels = load_images("dataset/", image_size=224)

Text -> Tokenized Tensors

X, y = load_text("reviews.csv", text_col="text", label_col="sentiment") Advanced Training Dynamic Learning Rate

Automatically adjust how fast the model learns based on performance.

Python

Drops LR when improvement stops

trainer = Trainer(model, scheduler="plateau")

Smoothly decays LR over time

trainer = Trainer(model, scheduler="cosine") Layer Growth

Let the model architecture expand if the current size isn't enough to solve the problem.

Python model = Model.classifier(10, [32], 3) trainer = Trainer(model)

Add a layer every 10 epochs if the loss plateaus

trainer.fit(X, y, epochs=50, grow_epochs=10, grow_max=3) API Reference Inference

Python engine = Inference( model_path, # Path to .pt file device=None # "cpu", "cuda", or "mps" )

engine.run(data) # Returns class index (e.g., 1) Model.load()

If you want to load a model to continue training rather than just for inference:

Python model = Model.load("my_model.pt") trainer = Trainer(model) trainer.fit(X, y, epochs=5) Model.vision()

Python model = Model.vision( num_classes=2, # Number of output categories backbone="resnet18", # Pretrained architecture pretrained=True # Use ImageNet weights ) Trainer.fit()

Python trainer.fit( X, y, # Tensors epochs=10, # Total passes batch_size=32, # Samples per step early_stopping=5 # Stop if no improvement for 5 epochs ) Tips Inference vs Trainer: Use Inference for web APIs or mobile apps; use Trainer.load if you need to keep training.

GPU: You don't need to call .to('cuda'). Everything in neurologic detects your hardware automatically.

Growing: If your loss is stuck high, try grow_epochs=5 to let the model add more "brain power" automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurologic-0.2.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurologic-0.2.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file neurologic-0.2.0.tar.gz.

File metadata

  • Download URL: neurologic-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for neurologic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 425d49768e9577ab521e92b1fb4adeb4dda319da0f554e76ef2d225c46e646d9
MD5 8ee4fbdd8e832f4a5899b72db50a69a4
BLAKE2b-256 6c71e9a2d530b6c8a30b20bb45e28823d1a2805b7efd31c9e12525a9cf8ff439

See more details on using hashes here.

File details

Details for the file neurologic-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: neurologic-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for neurologic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba4cb553f4758d0e856160a14a81fd3afcc3b2ef060a3f43844a5dd8dae3890d
MD5 e1a1c063a136dad41883cf355861a2fc
BLAKE2b-256 011dd6845eee1a73684dce40844e4b0320c5e50523811a3a50dd1b323f2256c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page