Installation¶
Basic Install¶
pip install neuraltrain
Then verify it works:
import neuraltrain
from neuraltrain import models
model_cfg = models.SimpleConvTimeAgg(hidden=32, depth=4, merger_config=None)
print(model_cfg)
Developer Install¶
For active development or to try the latest features:
Step 1: Create and activate a virtual environment:
uv venv .venv
source .venv/bin/activate
Step 2: Install neuraltrain in editable mode:
# from the repo root
uv pip install -e 'neuraltrain-repo/.[dev]'
# recommended: dev + all extras (models, metrics, lightning) — needed for all tutorials
uv pip install -e 'neuraltrain-repo/.[dev,all]'
Step 3: For strict type checking (optional):
uv pip install --config-settings editable_mode=strict -e 'neuraltrain-repo/.[dev,all]'
Step 4: Set up pre-commit hooks:
pre-commit install
Step 1: Create and activate a conda environment:
conda create -n neuraltrain python=3.12
conda activate neuraltrain
Step 2: Install pip and uv in the environment:
conda install pip
pip install uv
Step 3: Install neuraltrain in editable mode:
# from the repo root
uv pip install -e 'neuraltrain-repo/.[dev]'
# recommended: dev + all extras (models, metrics, lightning) — needed for all tutorials
uv pip install -e 'neuraltrain-repo/.[dev,all]'
Step 4: For strict type checking (optional):
uv pip install --config-settings editable_mode=strict -e 'neuraltrain-repo/.[dev,all]'
Step 5: Set up pre-commit hooks:
pre-commit install
Optional Extras¶
lightning— PyTorch Lightning and Weights & Biases support.models— optional dependencies for some model families (e.g.braindecode,x_transformers,green).dev— testing and documentation tools.
Notes¶
If a specific optional model fails to import, check that the corresponding extra (
.[models]) is installed in the current environment.The project example requires the
lightningextra to run.