Skip to main content

PyTorch benchmark scaffolding for latent neural dynamics models.

Project description

LaDyS (Latent Dynamical Systems) Package

LaDyS Lorenz attractor logo

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.1.tar.gz (28.8 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.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ladys-0.1.1.tar.gz
  • Upload date:
  • Size: 28.8 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.1.tar.gz
Algorithm Hash digest
SHA256 629de5d0cd2281d3a3b5d1aa91768f4f50465c22dd401abc7e575f3dd4efa673
MD5 c5a161b4cc701f03c1ec18f86a2ccd2a
BLAKE2b-256 709731a7ddc60c3b13b6d1f0c593aaa29924b53c4a7ebd22682eb6a89f26cd3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ladys-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: ladys-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89d3f71dc718b3996433d1187b0b16f46dfcda7c5d8bedf5e3d98a0c245f969a
MD5 c0660147bda8f736f15093db14beeae9
BLAKE2b-256 29bdc2ed3ca1738ca440bbdf7bce1143fee34185fd949c8f96d91704ebd71505

See more details on using hashes here.

Provenance

The following attestation bundles were made for ladys-0.1.1-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