Training Loop#
braintools.trainer is a lightweight, PyTorch-Lightning-style training loop for brainstate models: a LightningModule defines the training, validation and test steps, and a Trainer runs them with batching, a jit-compiled gradient step, callbacks, checkpoints and logging. The module is in maintenance mode: bugs are fixed, but no new features are planned.
What you’ll find here#
A training loop tutorial: a small classifier written as a
LightningModule,DataLoaderbatching of plain arrays, validation metrics,EarlyStopping,ModelCheckpointwithsave_top_k, aCSVLoggerwhosemetrics.csvis read back with pandas and plotted, inspecting a checkpoint withload_checkpoint, and evaluating a fresh model from the best checkpoint withTrainer.test(..., ckpt_path=...)andTrainer.predict.
For the full list of classes and parameters, see the API reference.