Skip to main content

PyTorch benchmark scaffolding for latent neural dynamics models.

Project description

LaDyS (Latent Dynamical Systems) Package

PyTorch benchmark scaffolding for latent variable models of neural dynamics.

The first API pass standardizes model construction, training/reporting contracts, and a Lorenz synthetic dataset. Models accept (batch, time, neurons) tensors in forward.

Initial Examples

  • ladys.models.cassm: thin adapter around the upstream sparse CASSM KalmanFilterSmoother implementation. Install the original cassm package or the local CASSM repository before constructing this model.
  • ladys.models.gpfa: Gaussian-observation GPFA with FA initialization, EM updates, and RBF GP timescale learning. One full-dataset E/M update is treated as one benchmark epoch.

References Inspected

  • Local planning note: /Users/jonathanhuml/Desktop/npdb.md
  • CASSM Lorenz data source: jonathanhuml/cassm/src/cassm/datasets
  • Local GPFA-MATLAB reference: /Users/jonathanhuml/Desktop/gpfa-matlab

Smoke Usage

PYTHONPATH=src python3 examples/smoke_compare.py

Public Experiment API

LaDyS is organized around three public pieces:

  • ladys.models: model configs build PyTorch nn.Module instances and carry their optimization settings.
  • ladys.data.DataModule: creates PyTorch train/validation datasets and dataloaders.
  • ladys.Experiment: gathers data, model, training, evaluation metrics, and artifacts into one inspectable run folder.

Run the canonical CLI path with a dataset and model:

ladys run -d lorenz -m cassm

The run folder includes config.json, history.csv, metrics.json, predictions.npz, model.pt, and report.md. The CLI also accepts full YAML experiment configs:

ladys run -c configs/experiment/gpfa_lorenz.yaml
ladys list datasets
ladys list models

Scaling Benchmark

PYTHONPATH=src python3 scripts/benchmark_lorenz_scaling.py \
  --models cassm gpfa \
  --neurons 10 100 1000 \
  --seeds 1

The script writes lorenz_scaling_results.csv, lorenz_scaling_results.npy, and time_vs_neurons.png under artifacts/lorenz_scaling/.

Loss-Curve Benchmark

PYTHONPATH=src python3 scripts/benchmark_lorenz_loss_curves.py \
  --models cassm gpfa \
  --neurons 100 \
  --epochs 30

The script writes lorenz_loss_history.csv, test_rate_mse_curves.png, test_objective_curves.png, train_test_objective_curves.png, and per-model held-out rate trace plots/CSVs under artifacts/lorenz_loss_curves/.

Preprocessing

Experiment YAML files can include a preprocessing block. The benchmark scripts apply this to dataset observations before models see them, while leaving Lorenz ground-truth rates unchanged for MSE metrics.

preprocessing:
  observations:
    name: smooth_firing_rate
    sampling_precision: 20.0
    kern_sd_ms: 50.0

configs/experiment/cassm_lorenz.yaml enables this CASSM-style spike smoothing. configs/experiment/gpfa_lorenz.yaml leaves observations raw.

See docs/model_output_contract.md for the forward-output convention. See docs/optimizer_contract.md for the benchmark epoch definition.

Documentation Site

Docs source lives under docs/ and is configured by mkdocs.yml. Model pages under docs/models/ are generated from model class docstrings and config defaults. Images referenced from model docstrings should live under docs/assets/ and can be linked as assets/<filename>:

python scripts/generate_model_docs.py
python scripts/generate_model_docs.py --check

Install the docs extra and serve the site locally:

pip install -e ".[docs]"
mkdocs serve

The GitHub Pages workflow publishes the root homepage at https://zkunkworks.com/ from website/ and the generated documentation at https://zkunkworks.com/ladys/.

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

ladys-0.1.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

ladys-0.1.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file ladys-0.1.0.tar.gz.

File metadata

  • Download URL: ladys-0.1.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ladys-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f70a48f186dd5fe26cb9271424d688b1bcba2c537a24503f09764982dbcfc7a9
MD5 4e0c2ce33c989b42ddbfa3de7e80c87e
BLAKE2b-256 b026ec3d045c7a088c9b6b7748caa67272bfd0b3c759315b091c43aee06373b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ladys-0.1.0.tar.gz:

Publisher: publish.yml on jonathanhuml/ladys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ladys-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ladys-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ladys-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86792f2ce86b6dc609e8a57cd4af867559d459595f7eb29d3b5eee0f37ce5b2c
MD5 b17fcad27b995e3ffa37b1e1ac23e7fc
BLAKE2b-256 52430003208054c0d7074b351ee981a158829e0520bbfb40aea295c64e0d9dab

See more details on using hashes here.

Provenance

The following attestation bundles were made for ladys-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jonathanhuml/ladys

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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