API Reference¶
Core¶
Create dataloaders for brain-modeling experiments. |
|
Brain-modeling experiment with support for loading pretrained weights. |
|
Orchestrate multiple |
Pytorch-lightning module for M/EEG model training. |
CLI¶
Run one or more NeuralBench experiments from Python. |
|
CLI entry point for |
Events Transforms¶
Clean and filter text-related events. |
|
Perform train/val/test split using sklearn's |
|
Perform train/val/test split based on similarity of sentence events. |
|
Assign train/test labels based on a predefined split, and optionally split train into validation as well. |
|
Keep up to max_wake_duration_min mins of wake (W) time before and after the first and last sleep events. |
|
Crop neuro timelines. |
|
Add default events to a timeline to fill out its duration. |
|
Offset selected events by specified amounts. |
Callbacks¶
Accumulate predictions on entire test set before evaluating metrics. |
|
Callback to evaluate average prediction over each recording (timeline). |
|
Visualize predictions vs ground truth for multi-dimensional regression tasks. |
|
Plot confusion matrix/matrices with a shared colorbar. |
Utilities¶
Joint configuration for Trainer and some callbacks. |
|
Load checkpoint through state_dicts. |
|
Compute class weights from training dataset for handling class imbalance. |
|
Create a weighted random sampler for the given dataset to handle class imbalance. |
Modules¶
Configuration for wrapping a (pretrained) model for downstream fine-tuning or linear probing. |
|
Wrapper for downstream evaluation of pretrained models. |
Configuration¶
Set up neuralbench configuration. |
|
Load neuralbench configuration. |
|
Get the current configuration, loading it if necessary. |