Project Structure¶
This repository is organized around the src/ package plus a small set of example entry points.
Top Level¶
neuroscience_control/
├── src/
├── examples/
├── tests/
├── docs/
├── paper/
├── data/
├── checkpoints/
├── results/
├── mkdocs.yml
└── pyproject.toml
src/¶
The current import namespace is src, not neuroscience_control.
src/dataset/¶
data_loader.py:NeuroscienceDataset, alternate constructors for LSD, nilearn, OpenNeuro, DataLad, and BIDS, plus FC/bandpass/Hilbert helpers.preprocessing.py: random window sampling, train/validation/test loader creation, and intrinsic-frequency estimation withcompute_omega_from_timeseries.
src/models/¶
base_model.py: common model interface, FC computation, checkpoint save/load scaffolding.hopf_model.py:CoupledHopfModel.hybrid_hopf_model.py:HybridHopfModelwith learnable complex coupling.gnn_hopf_model.py:GNNHopfModel.neural_sde.py:NeuralSDE.factory.py:build_model()used by the training scripts.checkpointing.py:load_model_from_checkpoint().
src/metrics/¶
fc_metrics.py:FCCorrelation,FCMSE,compute_static_fc.timeseries_metrics.py: spectrum, temporal correlation, autocorrelation,L2Timeseries,AmplitudeLoss,OmegaLoss, reference-stat helpers.dynamics_metrics.py:FCD,PhFCD,Metastability,PhaseFC, phase/FCD helper functions.metrics_store.py: JSON-backed metrics accumulation during training.
src/training/¶
config.py:TrainingConfigplusHopfConfig,HybridHopfConfig,GNNHopfConfig, andNeuralSDEConfig.trainer.py: backprop trainer with early stopping, W&B logging, checkpointing, and test loops.grid_search.py: Hopf grid search with optional composite scoring.losses.py:CompositeLossand registry wiring for the metric/loss modules.train_utils.py: backward-compatibleload_datasetre-export.
src/utils/¶
evaluation.py:evaluate_model_loader_metrics, figure generation helpers, checkpoint helpers,EVAL_METRIC_KEYS.runtime.py: device resolution, seeding, W&B wrappers.visualization.py: FC comparison plots, training curves, multi-grid simulation plots, and report figures.
examples/¶
train_models.py: main CLI forbackprop,hopf-grid, andpaper.postprocess.py: post-training CLI forupdate-tables,compare,compare-conditions, andpipeline.cli_args.py: shared dataset and atlas arguments used by the CLIs.visualization.py: 2D animated trajectory example.visualization_3d.py: 3D surface animation example.example.ipynb,pipeline_visualization.ipynb: notebooks.
tests/¶
The current tracked tests focus on model behavior and grid-search composition:
test_hopf_model.pytest_hybrid_hopf_model.pytest_gnn_hopf_model.pytest_grid_search_composite.py
Outputs and Supporting Assets¶
data/: local.matdata, LSD inputs, and downloaded dataset caches.checkpoints/: saved model checkpoints.results/: metrics JSON and evaluation outputs.paper/: figures and LaTeX tables used for manuscript artefacts.docs/: MkDocs source for the documentation site.