multimodalsrm 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- multimodalsrm-0.1.0/CHANGELOG.md +14 -0
- multimodalsrm-0.1.0/CITATION.cff +14 -0
- multimodalsrm-0.1.0/CONTRIBUTING.md +26 -0
- multimodalsrm-0.1.0/LICENSE +21 -0
- multimodalsrm-0.1.0/MANIFEST.in +9 -0
- multimodalsrm-0.1.0/PKG-INFO +128 -0
- multimodalsrm-0.1.0/README.md +80 -0
- multimodalsrm-0.1.0/docs/capabilities.md +47 -0
- multimodalsrm-0.1.0/docs/concepts.md +58 -0
- multimodalsrm-0.1.0/docs/data.md +55 -0
- multimodalsrm-0.1.0/docs/documentation.md +34 -0
- multimodalsrm-0.1.0/docs/extraction-validation.json +43 -0
- multimodalsrm-0.1.0/docs/getting-started.md +64 -0
- multimodalsrm-0.1.0/docs/index.md +37 -0
- multimodalsrm-0.1.0/docs/migration.md +36 -0
- multimodalsrm-0.1.0/docs/model-integration.md +31 -0
- multimodalsrm-0.1.0/docs/performance/2026-09-19-apple-mps-feasibility.md +78 -0
- multimodalsrm-0.1.0/docs/plans/2026-09-21-distribution-infrastructure.md +54 -0
- multimodalsrm-0.1.0/docs/plans/2026-09-21-model-extraction.md +27 -0
- multimodalsrm-0.1.0/docs/releasing.md +41 -0
- multimodalsrm-0.1.0/docs/superpowers/plans/2026-09-21-post-release-linux-performance-evaluation.md +171 -0
- multimodalsrm-0.1.0/docs/test-migration.json +9337 -0
- multimodalsrm-0.1.0/docs/testing.md +57 -0
- multimodalsrm-0.1.0/docs/tutorials.md +28 -0
- multimodalsrm-0.1.0/examples/gp_map_quickstart.py +99 -0
- multimodalsrm-0.1.0/examples/r_quickstart.py +95 -0
- multimodalsrm-0.1.0/model-integration.json +103 -0
- multimodalsrm-0.1.0/model-source.json +491 -0
- multimodalsrm-0.1.0/pyproject.toml +64 -0
- multimodalsrm-0.1.0/scripts/check_release.py +80 -0
- multimodalsrm-0.1.0/scripts/check_test_report.py +33 -0
- multimodalsrm-0.1.0/scripts/ci_policy.py +96 -0
- multimodalsrm-0.1.0/scripts/run_model_tests.py +82 -0
- multimodalsrm-0.1.0/setup.cfg +4 -0
- multimodalsrm-0.1.0/src/multimodalsrm/__init__.py +58 -0
- multimodalsrm-0.1.0/src/multimodalsrm/_observation_preparation.py +338 -0
- multimodalsrm-0.1.0/src/multimodalsrm/_parallel.py +74 -0
- multimodalsrm-0.1.0/src/multimodalsrm/_version.py +3 -0
- multimodalsrm-0.1.0/src/multimodalsrm/alignment.py +261 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/__init__.py +24 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/_archive.py +255 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/_backend.py +92 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/baselines.py +97 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/blocks.py +100 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/calibration.py +284 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/calibration_archive.py +70 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/calibration_problem.py +52 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/covariance_pairs.py +47 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/diagnostics.py +243 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/execution.py +37 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/factorization.py +107 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/fitting.py +810 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/gp_hyperparameters.py +51 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/grouped.py +105 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/grouped_score.py +42 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/identity.py +25 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/map_conditioning.py +237 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/map_parallel.py +56 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/model.py +951 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/multifactor.py +117 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/multifactor_cholesky.py +85 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/multifactor_score.py +49 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/noise_profile.py +287 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/observation_adapter.py +12 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/orientation_diagnostics.py +268 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/orientation_persistence.py +186 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/orthogonal.py +217 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/persistence.py +412 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/polishing.py +295 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/posterior_coordinates.py +36 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/posterior_participants.py +118 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/posterior_persistence.py +573 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/posterior_updates.py +499 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/prediction.py +380 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/priors.py +135 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/problem.py +470 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/quality.py +251 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/reference.py +94 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/refinement_coordinates.py +59 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/response_quadrature.py +243 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/response_scope.py +57 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/results.py +144 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/spectral.py +194 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space.py +354 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_bach.py +172 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_compact.py +329 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_delays.py +124 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_gaussian.py +172 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_gaussian_rational.py +195 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_parameters.py +411 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_rational.py +177 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/state_space_responses.py +267 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/temporal_noise.py +192 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/timing.py +30 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/trajectories.py +177 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/transform.py +199 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/updated_posterior_persistence.py +95 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/warmup_checkpoint.py +190 -0
- multimodalsrm-0.1.0/src/multimodalsrm/bayesian/workflow.py +270 -0
- multimodalsrm-0.1.0/src/multimodalsrm/calibration.py +380 -0
- multimodalsrm-0.1.0/src/multimodalsrm/data.py +84 -0
- multimodalsrm-0.1.0/src/multimodalsrm/estimator.py +617 -0
- multimodalsrm-0.1.0/src/multimodalsrm/grouping.py +33 -0
- multimodalsrm-0.1.0/src/multimodalsrm/inference.py +298 -0
- multimodalsrm-0.1.0/src/multimodalsrm/initialization.py +77 -0
- multimodalsrm-0.1.0/src/multimodalsrm/inspection.py +167 -0
- multimodalsrm-0.1.0/src/multimodalsrm/kernel_optimization.py +316 -0
- multimodalsrm-0.1.0/src/multimodalsrm/kernels.py +485 -0
- multimodalsrm-0.1.0/src/multimodalsrm/objective.py +437 -0
- multimodalsrm-0.1.0/src/multimodalsrm/operators.py +181 -0
- multimodalsrm-0.1.0/src/multimodalsrm/optimization.py +348 -0
- multimodalsrm-0.1.0/src/multimodalsrm/posterior_results.py +29 -0
- multimodalsrm-0.1.0/src/multimodalsrm/results.py +33 -0
- multimodalsrm-0.1.0/src/multimodalsrm/selection.py +574 -0
- multimodalsrm-0.1.0/src/multimodalsrm/validation.py +258 -0
- multimodalsrm-0.1.0/src/multimodalsrm.egg-info/PKG-INFO +128 -0
- multimodalsrm-0.1.0/src/multimodalsrm.egg-info/SOURCES.txt +225 -0
- multimodalsrm-0.1.0/src/multimodalsrm.egg-info/dependency_links.txt +1 -0
- multimodalsrm-0.1.0/src/multimodalsrm.egg-info/requires.txt +31 -0
- multimodalsrm-0.1.0/src/multimodalsrm.egg-info/top_level.txt +1 -0
- multimodalsrm-0.1.0/tests/__init__.py +1 -0
- multimodalsrm-0.1.0/tests/bayesian/__init__.py +1 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_analytic_score.py +57 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_bach_posterior.py +285 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_blocks.py +149 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_calibration.py +548 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_covariance_pairs.py +94 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_diagnostics.py +45 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_factorization.py +190 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_filter_recovery.py +31 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_fit_quality.py +203 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_frozen.py +178 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_gamma_posterior.py +505 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_gp_timescale.py +367 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_grouped.py +130 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_instantaneous.py +191 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_map_conditioning.py +308 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_map_parallel.py +177 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_mixed_responses.py +299 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_model.py +127 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_multifactor.py +383 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_multifactor_cpu.py +76 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_multifactor_posterior.py +242 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_multifactor_refinement.py +322 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_multifactor_workflow.py +19 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_noise_profile.py +403 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_optional_conventions.py +222 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_orientation_diagnostics.py +251 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_orientation_sampling.py +341 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_orthogonal_kernel.py +332 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_parallel.py +87 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_parameter_scaling.py +202 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_persistence.py +612 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_polishing_guard.py +157 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_posterior_evidence.py +21 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_posterior_participants.py +245 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_posterior_persistence.py +416 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_posterior_updates.py +353 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_prediction.py +151 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_problem.py +275 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_quadrature_accuracy.py +62 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_reference.py +251 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_refinement.py +269 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_residual_diagnostics.py +175 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_run_baselines.py +268 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_sampler_geometry.py +232 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_spectral.py +206 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space.py +228 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space_bach.py +180 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space_delays.py +234 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space_gaussian.py +160 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space_parameters.py +96 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_state_space_responses.py +198 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_temporal_noise.py +213 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_timing.py +100 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_trajectories.py +363 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_transform.py +236 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_updated_persistence.py +243 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_warmup_checkpoint.py +266 -0
- multimodalsrm-0.1.0/tests/bayesian/test_bayesian_workflow.py +121 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_bach.py +89 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_bach_inference.py +99 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_compact_gaussian.py +202 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_delays.py +51 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_gaussian.py +121 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_gaussian_method.py +121 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_optional_conventions.py +64 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_parameter_workflows.py +332 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_parameters.py +140 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_rational.py +164 -0
- multimodalsrm-0.1.0/tests/bayesian/test_state_space_responses.py +141 -0
- multimodalsrm-0.1.0/tests/core/__init__.py +1 -0
- multimodalsrm-0.1.0/tests/core/test_alignment_centering.py +55 -0
- multimodalsrm-0.1.0/tests/core/test_gaussian_operator_exact.py +49 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_alignment.py +178 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_calibration.py +233 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_components.py +421 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_cpu_algebra.py +206 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_fit.py +244 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_inference.py +175 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_initialization.py +137 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_inspection.py +69 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_kernel_acceleration.py +235 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_loading_scaling.py +195 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_optimization.py +165 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_parallel.py +194 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_primitives.py +206 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_reproducibility.py +41 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_scale.py +209 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_selection.py +554 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_shared_default.py +84 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_timing.py +146 -0
- multimodalsrm-0.1.0/tests/core/test_multimodal_validation.py +108 -0
- multimodalsrm-0.1.0/tests/core/test_observation_preparation.py +121 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_ci_policy.py +110 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_ci_workflows.py +73 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_model_test_report.py +39 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_package.py +36 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_release_gate.py +110 -0
- multimodalsrm-0.1.0/tests/infrastructure/test_sharding.py +65 -0
- multimodalsrm-0.1.0/tests/reference/__init__.py +1 -0
- multimodalsrm-0.1.0/tests/reference/continuous_covariance.py +202 -0
- multimodalsrm-0.1.0/tests/reference/multifactor_fixture.py +62 -0
- multimodalsrm-0.1.0/tests/reference/optimization_fixture.py +118 -0
- multimodalsrm-0.1.0/tests/reference/participant_conditioning.py +70 -0
- multimodalsrm-0.1.0/tests/reference/posterior_fixture.py +158 -0
- multimodalsrm-0.1.0/tests/smoke-tests.json +11 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Extract R-MSRM and GP-MSRM production modules from the frozen source handoff, retaining model objectives, response conventions, priors and numerical behavior.
|
|
6
|
+
- Expose `multimodalsrm.MultimodalSRM` and `multimodalsrm.bayesian.BayesianMultimodalSRM` with optional Bayesian dependencies.
|
|
7
|
+
- Transfer focused synthetic core/Bayesian tests and add small R fitting and GP MAP/archive-replay examples.
|
|
8
|
+
- Document supported posterior workflows, numerical backends, legacy archive compatibility and the source-bound warmup checkpoint contract.
|
|
9
|
+
- Retain Linux/macOS installed-wheel and installed-sdist CI, integration/version gates and release-driven Trusted Publishing infrastructure.
|
|
10
|
+
|
|
11
|
+
- Add a searchable Zensical documentation site with GitHub Pages deployment.
|
|
12
|
+
- Separate fast PR checks from the full Linux/macOS release suite.
|
|
13
|
+
|
|
14
|
+
This is the first package release of the extracted models. Test evidence belongs to the integration record and corresponding CI run; this changelog makes no calibration or recovery claim. Learned FIR responses remain deferred.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, cite this repository and the exact version or commit."
|
|
3
|
+
title: MultimodalSRM
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: Chang
|
|
7
|
+
given-names: Luke J.
|
|
8
|
+
repository-code: https://github.com/ljchang/multimodalsrm
|
|
9
|
+
url: https://ljchang.github.io/multimodalsrm/
|
|
10
|
+
version: 0.1.0
|
|
11
|
+
license: MIT
|
|
12
|
+
abstract: >-
|
|
13
|
+
Regularized and Gaussian-process shared response models for observations
|
|
14
|
+
across participants, modalities, and native sampling times.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
The extracted production models live in this repository. Research campaigns should consume a pinned package source commit or release. See the [integration provenance](docs/model-integration.md) before moving code between repositories.
|
|
4
|
+
|
|
5
|
+
Use Python 3.12 or later and an isolated environment. Install the base development tools with `python -m pip install -e '.[dev]'`; use `'.[dev,bayesian]'` for Bayesian work. Before submitting a pull request, run the checks applicable to the change:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
ruff check .
|
|
9
|
+
ruff format --check .
|
|
10
|
+
python -m pytest tests/infrastructure tests/core
|
|
11
|
+
JAX_ENABLE_X64=true JAX_PLATFORM_NAME=cpu python scripts/run_model_tests.py bayesian --smoke
|
|
12
|
+
python examples/r_quickstart.py
|
|
13
|
+
JAX_ENABLE_X64=true JAX_PLATFORM_NAME=cpu python examples/gp_map_quickstart.py
|
|
14
|
+
python -m build
|
|
15
|
+
python -m twine check --strict dist/*
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For documentation-only edits, lint, infrastructure checks and a package build are sufficient. Code PRs run the full core suite and Bayesian smoke tests on Linux. Bayesian changes should also run the affected tests; request **Full test suite** in GitHub Actions for broader numerical or platform coverage before merging. Every release must pass that complete suite, including Linux/macOS and installed wheels/source distributions. See the [test policy](docs/testing.md) for routing rules and full-suite commands.
|
|
19
|
+
|
|
20
|
+
Bayesian tests and examples require the optional Bayesian extra. CI also checks installed artifacts. Validate workflow edits with `actionlint` when available. Tests should exercise observable behavior using synthetic data. Do not commit participant observations, fitted states, private data paths or research archive payloads. Keep the base package import independent of optional Bayesian/plotting backends and legacy comparator dependencies.
|
|
21
|
+
|
|
22
|
+
Do not change a statistical target, default, coordinate convention or archive schema as an incidental consequence of packaging work. Explain intentional changes and their validation in the pull request. Preserve target exclusion before preprocessing and participant isolation in independent-run inference. Keep serialization identifiers stable; see [migration](docs/migration.md).
|
|
23
|
+
|
|
24
|
+
Contributions are made under the repository's MIT license. Retain applicable authorship and third-party notices when transferring code. Report software checks, numerical qualification, fit convergence, uncertainty calibration, response recovery and empirical validity separately. A small synthetic example is not a recovery study.
|
|
25
|
+
|
|
26
|
+
Documentation lives in `docs/` and is published with Zensical. Install `requirements-docs.txt`, preview with `zensical serve`, and check links with `zensical build --clean --strict`. See the [documentation guide](docs/documentation.md) for navigation and deployment.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luke J. Chang and MultimodalSRM contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
include LICENSE README.md CHANGELOG.md CONTRIBUTING.md CITATION.cff
|
|
2
|
+
include model-integration.json model-source.json
|
|
3
|
+
recursive-include docs *.md
|
|
4
|
+
recursive-include docs *.json
|
|
5
|
+
recursive-include examples *.py
|
|
6
|
+
recursive-include scripts *.py
|
|
7
|
+
recursive-include tests *.py
|
|
8
|
+
recursive-include tests *.json
|
|
9
|
+
global-exclude __pycache__ *.py[cod] .DS_Store
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: multimodalsrm
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Shared response models for native-time multimodal observations
|
|
5
|
+
Author: Luke J. Chang
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ljchang/multimodalsrm
|
|
8
|
+
Project-URL: Documentation, https://ljchang.github.io/multimodalsrm/
|
|
9
|
+
Project-URL: Repository, https://github.com/ljchang/multimodalsrm
|
|
10
|
+
Project-URL: Issues, https://github.com/ljchang/multimodalsrm/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/ljchang/multimodalsrm/blob/main/CHANGELOG.md
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: numpy>=1.26
|
|
21
|
+
Requires-Dist: scipy>=1.11
|
|
22
|
+
Requires-Dist: scikit-learn>=1.4
|
|
23
|
+
Requires-Dist: joblib>=1.3
|
|
24
|
+
Requires-Dist: threadpoolctl>=3
|
|
25
|
+
Provides-Extra: bayesian
|
|
26
|
+
Requires-Dist: jax==0.11.2; extra == "bayesian"
|
|
27
|
+
Requires-Dist: jaxlib==0.11.2; extra == "bayesian"
|
|
28
|
+
Requires-Dist: numpyro==0.22.0; extra == "bayesian"
|
|
29
|
+
Requires-Dist: arviz==1.3.0; extra == "bayesian"
|
|
30
|
+
Requires-Dist: xarray>=2024.1; extra == "bayesian"
|
|
31
|
+
Provides-Extra: plots
|
|
32
|
+
Requires-Dist: matplotlib>=3.8; extra == "plots"
|
|
33
|
+
Provides-Extra: test
|
|
34
|
+
Requires-Dist: pytest>=9; extra == "test"
|
|
35
|
+
Requires-Dist: packaging>=24; extra == "test"
|
|
36
|
+
Requires-Dist: matplotlib>=3.8; extra == "test"
|
|
37
|
+
Requires-Dist: psutil>=5.9; extra == "test"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=9; extra == "dev"
|
|
40
|
+
Requires-Dist: packaging>=24; extra == "dev"
|
|
41
|
+
Requires-Dist: matplotlib>=3.8; extra == "dev"
|
|
42
|
+
Requires-Dist: psutil>=5.9; extra == "dev"
|
|
43
|
+
Requires-Dist: ruff>=0.11; extra == "dev"
|
|
44
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
45
|
+
Requires-Dist: twine>=6; extra == "dev"
|
|
46
|
+
Requires-Dist: PyYAML>=6; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# MultimodalSRM
|
|
50
|
+
|
|
51
|
+
[](https://github.com/ljchang/multimodalsrm/actions/workflows/ci.yml)
|
|
52
|
+
[](https://ljchang.github.io/multimodalsrm/)
|
|
53
|
+
[](LICENSE)
|
|
54
|
+
|
|
55
|
+
Shared response models for observations measured across people, modalities and native sampling times.
|
|
56
|
+
|
|
57
|
+
**Version `0.1.0`.** This package contains the extracted R-MSRM and GP-MSRM implementations. Software checks, fit convergence, uncertainty calibration and empirical recovery are separate claims.
|
|
58
|
+
|
|
59
|
+
## Models
|
|
60
|
+
|
|
61
|
+
- **R-MSRM (`MultimodalSRM`)** estimates one exact common latent response per run by default, with participant–modality mappings and regularized response kernels.
|
|
62
|
+
- **GP-MSRM (`BayesianMultimodalSRM`)** uses a continuous shared latent Gaussian process, individual observation mappings, explicit priors, MAP estimation and supported posterior workflows.
|
|
63
|
+
|
|
64
|
+
Both use named native-time observations, masks and missing streams. They preserve explicit information boundaries for held-out prediction. Learned FIR responses are deferred. Legacy neighborhood, graph, mixture and reference estimators are not exported by this package. See the [capability and backend matrix](docs/capabilities.md) before choosing a workflow.
|
|
65
|
+
|
|
66
|
+
## Install
|
|
67
|
+
|
|
68
|
+
Python 3.12 or later is required. Install the release from PyPI:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
python -m pip install "multimodalsrm==0.1.0"
|
|
72
|
+
# Optional Bayesian runtime:
|
|
73
|
+
python -m pip install "multimodalsrm[bayesian]==0.1.0"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Enable float64 before using the Bayesian model (`JAX_ENABLE_X64=true`). See the [installation guide](https://ljchang.github.io/multimodalsrm/getting-started/) for environment setup.
|
|
77
|
+
|
|
78
|
+
### Development and runnable examples
|
|
79
|
+
|
|
80
|
+
The example scripts live in the source repository. From a clone:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
python3.12 -m venv .venv
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
python -m pip install -e .
|
|
86
|
+
python examples/r_quickstart.py
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For the optional Bayesian runtime:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
python -m pip install -e '.[bayesian]'
|
|
93
|
+
JAX_ENABLE_X64=true JAX_PLATFORM_NAME=cpu python examples/gp_map_quickstart.py
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The base install does not require JAX, NumPyro, ArviZ or plotting libraries. The Bayesian extra pins the runtime used by the source handoff; enabling float64 is required. Editable source installs follow the checkout; use the `v0.1.0` tag to match this release.
|
|
97
|
+
|
|
98
|
+
## Data and imports
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from multimodalsrm import MultimodalSRM, TimeSeries, Identity, Gaussian, Response
|
|
102
|
+
from multimodalsrm.bayesian import BayesianMultimodalSRM, BayesianPriors
|
|
103
|
+
|
|
104
|
+
# values: (observations, features); times: (observations,).
|
|
105
|
+
# Each modality retains its own timestamps. A mask marks observed entries.
|
|
106
|
+
# data = {participant: {run: {modality: TimeSeries(values, times, mask)}}}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Use consistent timestamp units across streams. Separate runs have separate latent responses; participants viewing the same run share one response. `features=K` chooses the latent dimensionality rather than estimating K. The [runnable tutorials](docs/tutorials.md) demonstrate fitting, explicit target exclusion, independent new runs and GP archive replay on small synthetic data.
|
|
110
|
+
|
|
111
|
+
## Documentation and development
|
|
112
|
+
|
|
113
|
+
- **[Read the documentation](https://ljchang.github.io/multimodalsrm/)** — installation, data preparation, model concepts, and tutorials.
|
|
114
|
+
- [Documentation overview](docs/index.md), [installation](docs/getting-started.md), and [model concepts](docs/concepts.md)
|
|
115
|
+
- [Tutorials](docs/tutorials.md) and [capabilities](docs/capabilities.md)
|
|
116
|
+
- [Preview and contribute to the Zensical site](docs/documentation.md)
|
|
117
|
+
- [Migration and archive compatibility](docs/migration.md)
|
|
118
|
+
- [Source integration and provenance](docs/model-integration.md)
|
|
119
|
+
- [CI and test policy](docs/testing.md)
|
|
120
|
+
- [Release setup](docs/releasing.md), [contributing](CONTRIBUTING.md) and [changelog](CHANGELOG.md)
|
|
121
|
+
- [Post-release Linux CPU/GPU evaluation plan](docs/superpowers/plans/2026-09-21-post-release-linux-performance-evaluation.md)
|
|
122
|
+
- [Prior Apple MPS feasibility findings](docs/performance/2026-09-19-apple-mps-feasibility.md)
|
|
123
|
+
|
|
124
|
+
Routine PR checks use documentation-only checks or Linux core regressions and Bayesian smoke tests, depending on the changed files. The full Linux/macOS suites and wheel/source-distribution checks run on request and before every release. See the [test policy](docs/testing.md) and current CI run for coverage and evidence. Passing CI does not certify scientific validity or authorize a new release.
|
|
125
|
+
|
|
126
|
+
## License and citation
|
|
127
|
+
|
|
128
|
+
MIT licensed; see [LICENSE](LICENSE). The implementation was extracted from Luke J. Chang's [shared-response-models](https://github.com/ljchang/shared-response-models) research repository with contributor provenance retained in the [integration record](docs/model-integration.md). Citation metadata is in [CITATION.cff](CITATION.cff). No package DOI or associated publication is claimed. Research observations and fitted archives are not distributed.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# MultimodalSRM
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ljchang/multimodalsrm/actions/workflows/ci.yml)
|
|
4
|
+
[](https://ljchang.github.io/multimodalsrm/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Shared response models for observations measured across people, modalities and native sampling times.
|
|
8
|
+
|
|
9
|
+
**Version `0.1.0`.** This package contains the extracted R-MSRM and GP-MSRM implementations. Software checks, fit convergence, uncertainty calibration and empirical recovery are separate claims.
|
|
10
|
+
|
|
11
|
+
## Models
|
|
12
|
+
|
|
13
|
+
- **R-MSRM (`MultimodalSRM`)** estimates one exact common latent response per run by default, with participant–modality mappings and regularized response kernels.
|
|
14
|
+
- **GP-MSRM (`BayesianMultimodalSRM`)** uses a continuous shared latent Gaussian process, individual observation mappings, explicit priors, MAP estimation and supported posterior workflows.
|
|
15
|
+
|
|
16
|
+
Both use named native-time observations, masks and missing streams. They preserve explicit information boundaries for held-out prediction. Learned FIR responses are deferred. Legacy neighborhood, graph, mixture and reference estimators are not exported by this package. See the [capability and backend matrix](docs/capabilities.md) before choosing a workflow.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
Python 3.12 or later is required. Install the release from PyPI:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
python -m pip install "multimodalsrm==0.1.0"
|
|
24
|
+
# Optional Bayesian runtime:
|
|
25
|
+
python -m pip install "multimodalsrm[bayesian]==0.1.0"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Enable float64 before using the Bayesian model (`JAX_ENABLE_X64=true`). See the [installation guide](https://ljchang.github.io/multimodalsrm/getting-started/) for environment setup.
|
|
29
|
+
|
|
30
|
+
### Development and runnable examples
|
|
31
|
+
|
|
32
|
+
The example scripts live in the source repository. From a clone:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
python3.12 -m venv .venv
|
|
36
|
+
source .venv/bin/activate
|
|
37
|
+
python -m pip install -e .
|
|
38
|
+
python examples/r_quickstart.py
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For the optional Bayesian runtime:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
python -m pip install -e '.[bayesian]'
|
|
45
|
+
JAX_ENABLE_X64=true JAX_PLATFORM_NAME=cpu python examples/gp_map_quickstart.py
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The base install does not require JAX, NumPyro, ArviZ or plotting libraries. The Bayesian extra pins the runtime used by the source handoff; enabling float64 is required. Editable source installs follow the checkout; use the `v0.1.0` tag to match this release.
|
|
49
|
+
|
|
50
|
+
## Data and imports
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from multimodalsrm import MultimodalSRM, TimeSeries, Identity, Gaussian, Response
|
|
54
|
+
from multimodalsrm.bayesian import BayesianMultimodalSRM, BayesianPriors
|
|
55
|
+
|
|
56
|
+
# values: (observations, features); times: (observations,).
|
|
57
|
+
# Each modality retains its own timestamps. A mask marks observed entries.
|
|
58
|
+
# data = {participant: {run: {modality: TimeSeries(values, times, mask)}}}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use consistent timestamp units across streams. Separate runs have separate latent responses; participants viewing the same run share one response. `features=K` chooses the latent dimensionality rather than estimating K. The [runnable tutorials](docs/tutorials.md) demonstrate fitting, explicit target exclusion, independent new runs and GP archive replay on small synthetic data.
|
|
62
|
+
|
|
63
|
+
## Documentation and development
|
|
64
|
+
|
|
65
|
+
- **[Read the documentation](https://ljchang.github.io/multimodalsrm/)** — installation, data preparation, model concepts, and tutorials.
|
|
66
|
+
- [Documentation overview](docs/index.md), [installation](docs/getting-started.md), and [model concepts](docs/concepts.md)
|
|
67
|
+
- [Tutorials](docs/tutorials.md) and [capabilities](docs/capabilities.md)
|
|
68
|
+
- [Preview and contribute to the Zensical site](docs/documentation.md)
|
|
69
|
+
- [Migration and archive compatibility](docs/migration.md)
|
|
70
|
+
- [Source integration and provenance](docs/model-integration.md)
|
|
71
|
+
- [CI and test policy](docs/testing.md)
|
|
72
|
+
- [Release setup](docs/releasing.md), [contributing](CONTRIBUTING.md) and [changelog](CHANGELOG.md)
|
|
73
|
+
- [Post-release Linux CPU/GPU evaluation plan](docs/superpowers/plans/2026-09-21-post-release-linux-performance-evaluation.md)
|
|
74
|
+
- [Prior Apple MPS feasibility findings](docs/performance/2026-09-19-apple-mps-feasibility.md)
|
|
75
|
+
|
|
76
|
+
Routine PR checks use documentation-only checks or Linux core regressions and Bayesian smoke tests, depending on the changed files. The full Linux/macOS suites and wheel/source-distribution checks run on request and before every release. See the [test policy](docs/testing.md) and current CI run for coverage and evidence. Passing CI does not certify scientific validity or authorize a new release.
|
|
77
|
+
|
|
78
|
+
## License and citation
|
|
79
|
+
|
|
80
|
+
MIT licensed; see [LICENSE](LICENSE). The implementation was extracted from Luke J. Chang's [shared-response-models](https://github.com/ljchang/shared-response-models) research repository with contributor provenance retained in the [integration record](docs/model-integration.md). Citation metadata is in [CITATION.cff](CITATION.cff). No package DOI or associated publication is claimed. Research observations and fitted archives are not distributed.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Capabilities and evidence boundaries
|
|
2
|
+
|
|
3
|
+
Both model families use named observations of the form `{participant: {run: {modality: TimeSeries(...)}}}` on native clocks. `TimeSeries.values` is observations by features. Missing observations use masks; missing streams may be omitted. The default model has one exact shared latent response per run and individual participant–modality mappings. Separate private trajectories, learned graphs and participant-specific response pooling are not part of the supported GP posterior target.
|
|
4
|
+
|
|
5
|
+
## Estimation and numerical backends
|
|
6
|
+
|
|
7
|
+
MAP is an estimation method. `linear_algebra` selects a GP computational backend; the two choices are separate.
|
|
8
|
+
|
|
9
|
+
| Model / operation | Supported scope | Boundary |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| R-MSRM regularized fit | Shared latent grid (`latent_dt`), individual mappings, fixed or estimated parametric responses; fit, infer, target-excluded prediction and calibration | Regularization and response constraints influence identifiability; no posterior uncertainty claim |
|
|
12
|
+
| GP MAP, `linear_algebra="dense"` or `"grouped"` | Continuous Matérn GP; analytic Identity/Gaussian; explicit quadrature for Gamma/DoubleGamma/BachSCR | Grouped algebra preserves the modeled likelihood; it is not a different prior |
|
|
13
|
+
| GP MAP, `linear_algebra="state_space"` | Explicit opt-in Identity, Gaussian, fixed integer-shape Gamma/DoubleGamma, and fixed-shape BachSCR; independent noise | Response approximations and restored tails need the declared covariance error tolerance; no state-space posterior sampling |
|
|
14
|
+
| GP `linear_algebra="spectral"` | Explicit finite-basis approximation retained from the source implementation | Rank/padding and boundary errors need separate qualification; not the full supported posterior workflow below |
|
|
15
|
+
| Full GP posterior training and joint updates | Dense/grouped; independent observation noise; no run baselines; fixed unit GP variance; fixed or learned single shared GP timescale | No sampled-kernel posterior, participant response pooling, factor-specific timescales or state-space sampling |
|
|
16
|
+
| Joint posterior trajectories | `sample_latent` on supported training, donor-update, calibrated and independent-participant posterior models | Request all times for a joint calculation together; separate calls do not preserve cross-call correlation |
|
|
17
|
+
|
|
18
|
+
Full posterior responses are analytic Identity/Gaussian or Gamma/DoubleGamma/BachSCR enabled with an explicit `response_quadrature_order`. Quadrature approximates response integrals, while the latent process remains continuous. Compare integration orders and independent integrals over the declared parameter bounds; the analytic `covariance_tolerance` does not certify quadrature accuracy. BachSCR requires fixing `t0` when learning lag. Learned FIR responses remain deferred; `SampledKernel` does not imply a sampled-response posterior implementation.
|
|
19
|
+
|
|
20
|
+
State-space MAP uses native-time Matérn-3/2 Kalman inference and an RTS smoother. Gaussian responses use rational or Laguerre approximation; Gamma shapes remain fixed while supported scales and lags may be estimated. BachSCR permits lag estimation with fixed shape, and restoring its truncated tail can require a larger error tolerance. These backend choices do not change MAP into posterior inference.
|
|
21
|
+
|
|
22
|
+
A learned `length_scale` uses a bounded physical `Prior` with finite, strictly positive bounds. One timescale is shared across factors and runs; loadings set amplitude while GP variance stays one. Learning the timescale changes the inference target and requires new convergence/identification checks. MAP options outside the full posterior scope, such as fixed run-baseline priors, must not be assumed to carry over to joint posterior updates.
|
|
23
|
+
|
|
24
|
+
## Responses and workflow semantics
|
|
25
|
+
|
|
26
|
+
`Response(..., estimate=True, fixed={...})` estimates only unfixed parameters, within explicit bounds. For example, `Response(Gaussian(width=0.3), estimate=True, fixed={"width": 0.3}, bounds={"lag": (-1.5, 1.5)}, pooling="shared")` estimates a shared lag while preserving width. Response support can remove edge observations; inspect output validity masks rather than treating every requested time as observed or usable.
|
|
27
|
+
|
|
28
|
+
R `predict(data, targets=..., source=...)` excludes all named target payloads before preparation. Its `source` selects within-participant, across-participant or combined observations. R fitting estimates preprocessing from training data and reuses it for new-run predictions.
|
|
29
|
+
|
|
30
|
+
For GP MAP, `condition(donors, targets=..., mode="frozen")` conditions new runs while holding training MAP parameters fixed. Its uncertainty is conditional on that MAP, not parameter-posterior uncertainty. The small [GP example](https://github.com/ljchang/multimodalsrm/blob/main/examples/gp_map_quickstart.py) demonstrates this route. GP uses supplied observation units; if using `TrainingStandardizer`, fit it on training observations only, exclude held-out targets before transforming donors, and save it with the model.
|
|
31
|
+
|
|
32
|
+
For a full supported GP posterior:
|
|
33
|
+
|
|
34
|
+
- `condition(..., mode="joint")` refits and samples the reference plus the current donor batch, including the prior once. Repeated calls replace the donor batch; provide the complete batch to retain several new runs.
|
|
35
|
+
- `calibrate_posterior(...)` jointly samples group and new-participant parameters using original training run IDs and in-domain calibration times. Each feature needs at least `K+1` support-eligible observations; this is a feasibility condition.
|
|
36
|
+
- `condition_participants(...)` returns one updated posterior per participant, using only that participant's current independent-run observations in addition to the fitted reference.
|
|
37
|
+
- `infer_latent(...)` reports marginal moments and mixture components. `sample_latent(...)` draws joint conditional paths across times and factors, preserving parameter-draw uncertainty. Additional trajectories per parameter draw do not increase parameter effective sample size.
|
|
38
|
+
|
|
39
|
+
Multifactor posterior fits require explicit training `factor_anchors`, one observed training feature per factor. Draw-specific QR rotations define reporting coordinates; raw parameter draws and their diagnostics are retained. An anchor or fixed-lag reference does not establish absolute physiological timing.
|
|
40
|
+
|
|
41
|
+
Existing `.calibrate` and `.transform` APIs retain their MAP meanings. Do not interpret them as the joint posterior methods above. New run IDs must be distinct from reference training IDs where a new independent run is required.
|
|
42
|
+
|
|
43
|
+
## Interpreting outputs
|
|
44
|
+
|
|
45
|
+
Inspect `converged_` for R fits and `map_diagnostics_` for GP MAP fits. Posterior fits require `sampling_diagnostics_`, including raw parameters, reporting orientation, divergences, tree depth and BFMI. A successful API call, archive replay or test run does not establish convergence. Marginal intervals do not automatically form simultaneous trajectory bands.
|
|
46
|
+
|
|
47
|
+
Frozen source studies qualify bounded synthetic configurations only. Their results do not establish general coverage, arbitrary-rank convergence, broad response/timing recovery, empirical scalability or physiological mechanisms, and do not automatically transfer to new runtimes. Report prediction, response recovery, convergence, numerical accuracy and uncertainty calibration separately.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# How the models work
|
|
2
|
+
|
|
3
|
+
## One shared response, several observation streams
|
|
4
|
+
|
|
5
|
+
Suppose several people observe the same movie. Brain measurements and behavioral ratings can reflect a shared time-varying signal while having different numbers of features, sampling rates, delays, and noise.
|
|
6
|
+
|
|
7
|
+
MultimodalSRM represents that signal using `K` latent factors. For each run, the default model shares exactly the same latent response across participants. Individual participant–modality mappings translate those factors into the measured feature space.
|
|
8
|
+
|
|
9
|
+
The observation model can be read schematically as:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
shared latent response for a run
|
|
13
|
+
→ modality response filter (smoothing and delay)
|
|
14
|
+
→ participant–modality feature mapping
|
|
15
|
+
→ predicted observations at the stream's native timestamps
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Noise and the model's preprocessing or offset terms account for the remaining observation structure. This is a schematic description; the two model families use different objectives and uncertainty assumptions.
|
|
19
|
+
|
|
20
|
+
`features=K` selects the number of latent factors. It is an analysis choice, not an automatically inferred number of underlying biological processes. Factor coordinates also need conventions: rotations or sign changes can describe equivalent representations.
|
|
21
|
+
|
|
22
|
+
## R-MSRM: regularized estimation
|
|
23
|
+
|
|
24
|
+
`MultimodalSRM` represents the latent response on a grid with spacing `latent_dt`. It estimates latent values, participant–modality mappings, and any free response parameters through regularized optimization.
|
|
25
|
+
|
|
26
|
+
The regularization controls the fitted representation. Multiple initializations can explore different optimization outcomes, but a low objective alone does not establish convergence or correct response-filter recovery. Inspect `converged_` and the fitted diagnostics.
|
|
27
|
+
|
|
28
|
+
Once trained, the model can infer latent responses and predict excluded targets on new runs using learned mappings and response parameters. Separate calibration data can estimate a new participant's mapping. R-MSRM does not provide Bayesian posterior uncertainty.
|
|
29
|
+
|
|
30
|
+
Start with the [R tutorial](tutorials.md#r-msrm-fit-and-held-out-prediction).
|
|
31
|
+
|
|
32
|
+
## GP-MSRM: a continuous latent process
|
|
33
|
+
|
|
34
|
+
`BayesianMultimodalSRM` places a Gaussian-process prior on the shared latent response. Its `length_scale` controls the timescale of latent variation; it is distinct from a modality's response-filter width.
|
|
35
|
+
|
|
36
|
+
Observation covariances follow from the GP prior, response filters, feature mappings, and noise. The latent GP is marginalized when fitting the supported MAP and posterior parameter targets. Latent responses can then be inferred conditionally on observations and fitted or sampled parameters.
|
|
37
|
+
|
|
38
|
+
**MAP estimation** finds a parameter setting with high posterior density. Frozen conditioning holds those training parameters fixed when incorporating observations from a new run. Its predictive uncertainty is conditional on that MAP estimate and does not include parameter-posterior uncertainty.
|
|
39
|
+
|
|
40
|
+
**Posterior sampling** retains parameter draws for supported targets. Those draws can propagate parameter uncertainty into predictions and joint latent trajectories. Sampling needs its own convergence and diagnostic checks; it is not implied by using the Bayesian class or obtaining prediction intervals.
|
|
41
|
+
|
|
42
|
+
`linear_algebra` chooses the computational backend separately from MAP versus sampling. Dense and grouped algebra support the documented posterior workflows. State-space computation is an opt-in MAP backend with response-specific approximation constraints. Consult the [support matrix](capabilities.md) for exact combinations.
|
|
43
|
+
|
|
44
|
+
Start with the [GP MAP tutorial](tutorials.md#gp-msrm-map-and-fitted-archive-replay).
|
|
45
|
+
|
|
46
|
+
## Response filters and timing
|
|
47
|
+
|
|
48
|
+
An Identity response uses the latent signal directly. A Gaussian response can smooth and delay it. Other supported parametric families represent different response shapes. Parameters can be fixed or estimated subject to explicit bounds and supported pooling rules.
|
|
49
|
+
|
|
50
|
+
For example, fixing a Gaussian width while estimating lag asks a different question from estimating both. A broad latent GP timescale and a broad response filter can both smooth observations, making their separate interpretation difficult. A chosen reference or factor anchor supplies a coordinate convention; it does not establish physiological timing.
|
|
51
|
+
|
|
52
|
+
Learned FIR responses are deferred. The presence of an internal kernel type does not imply it supports every inference method.
|
|
53
|
+
|
|
54
|
+
## Evaluate the claim you want to make
|
|
55
|
+
|
|
56
|
+
Held-out prediction asks whether available observations predict excluded targets. Response recovery asks whether fitted filter parameters match a known generating mechanism. Convergence asks whether numerical optimization or sampling adequately explored the intended target. These require different evidence.
|
|
57
|
+
|
|
58
|
+
Use protected training/test splits, explicit target exclusion, appropriate fit diagnostics, and matched synthetic controls where recovery matters. The [capabilities guide](capabilities.md) describes interpretation boundaries for each workflow.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Prepare your data
|
|
2
|
+
|
|
3
|
+
Both models accept a nested mapping:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
participant → run → modality → TimeSeries
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
A `TimeSeries` holds an array of shape `(observations, features)` and a timestamp vector of shape `(observations,)`. Each stream keeps its own sampling times. Use consistent time units across all streams; lag, response width, latent grid spacing, and GP timescale use those units.
|
|
10
|
+
|
|
11
|
+
## A small input example
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
import numpy as np
|
|
15
|
+
from multimodalsrm import TimeSeries
|
|
16
|
+
|
|
17
|
+
brain_times = np.arange(0.0, 20.0, 2.0)
|
|
18
|
+
rating_times = np.arange(0.0, 20.0, 0.5)
|
|
19
|
+
brain = np.column_stack([np.sin(brain_times), np.cos(brain_times)])
|
|
20
|
+
rating = np.sin(rating_times)[:, None]
|
|
21
|
+
|
|
22
|
+
observed = np.ones_like(rating, dtype=bool)
|
|
23
|
+
observed[5:8] = False
|
|
24
|
+
|
|
25
|
+
data = {
|
|
26
|
+
"participant-01": {
|
|
27
|
+
"movie-01": {
|
|
28
|
+
"brain": TimeSeries(brain, brain_times),
|
|
29
|
+
"rating": TimeSeries(rating, rating_times, observed),
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This demonstrates the input structure; use the [tutorial scripts](tutorials.md) for complete fitting examples with multiple participants. Missing streams may be omitted. A mask marks observed entries within an available stream.
|
|
36
|
+
|
|
37
|
+
## Give run names scientific meaning
|
|
38
|
+
|
|
39
|
+
Participants observing the same aligned recording should use the same run ID and time origin. That ID associates their observations with one shared latent response. Different recordings have different run IDs and separate latent responses.
|
|
40
|
+
|
|
41
|
+
An independent test recording must have a new run ID. Reusing a training run name does not make it an independent prediction problem.
|
|
42
|
+
|
|
43
|
+
## Separate training, donors, and targets
|
|
44
|
+
|
|
45
|
+
Training observations estimate mappings and response parameters. Donor observations provide information when inferring a response or predicting an excluded target. A target is the participant–modality stream being predicted.
|
|
46
|
+
|
|
47
|
+
For R-MSRM, pass explicit `targets` to `predict`. For GP-MSRM, pass them to `condition`. Named target payloads are excluded before model preparation. Any preprocessing you perform yourself must respect the same exclusion; the model cannot undo information leakage introduced earlier.
|
|
48
|
+
|
|
49
|
+
R-MSRM learns its preprocessing from training observations and reuses it. GP-MSRM operates in supplied observation units. If you use an external standardizer for GP data, fit it only on training observations and retain it with the fitted model.
|
|
50
|
+
|
|
51
|
+
## Inspect valid support
|
|
52
|
+
|
|
53
|
+
A response filter can require observations beyond the requested prediction time. Near recording boundaries, some outputs can therefore be invalid. Use returned validity masks when scoring or plotting; do not assume every requested time is supported.
|
|
54
|
+
|
|
55
|
+
See [how the models work](concepts.md) for the relationship between shared responses, individual mappings, and response filters.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Contribute to the documentation
|
|
2
|
+
|
|
3
|
+
The site is built with [Zensical](https://zensical.org/) from the Markdown files in `docs/`. Navigation and theme settings live in `zensical.toml`. Edit the source through a pull request; do not commit generated `site/` files.
|
|
4
|
+
|
|
5
|
+
## Preview locally
|
|
6
|
+
|
|
7
|
+
From the repository root, in a Python environment:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
python -m pip install -r requirements-docs.txt
|
|
11
|
+
zensical serve
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Open the local URL printed by the server. Documentation dependencies are separate from the model dependencies, so writing prose does not require installing JAX or running model fits.
|
|
15
|
+
|
|
16
|
+
Before submitting, run the same strict build as CI:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
zensical build --clean --strict
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The build validates internal links and anchors. Add new reader-facing pages to the navigation in `zensical.toml`. Historical implementation plans remain available by direct link but are excluded from site search. Use relative links between documentation pages. Link to GitHub for files outside `docs/`, such as runnable examples and source manifests, so links work both in the repository and on the site.
|
|
23
|
+
|
|
24
|
+
## Review and deployment
|
|
25
|
+
|
|
26
|
+
Fast PR CI builds the site inside its required quality job. Prose and site-configuration changes use the lightweight documentation profile; model, test, and workflow changes retain code checks. See [test policy](testing.md).
|
|
27
|
+
|
|
28
|
+
The separate **Documentation** workflow rebuilds and deploys the site after a push to `main`. It can also be run manually on `main`. PRs and other branches cannot deploy. The deployment job alone receives Pages and OIDC write permissions, and GitHub's `github-pages` environment can add deployment protection rules.
|
|
29
|
+
|
|
30
|
+
The site is live at [ljchang.github.io/multimodalsrm](https://ljchang.github.io/multimodalsrm/). GitHub Pages uses **Settings → Pages → Build and deployment → Source: GitHub Actions**. Confirm the workflow and live URL after merging; a successful local build is not a deployment.
|
|
31
|
+
|
|
32
|
+
## Scope of this first site
|
|
33
|
+
|
|
34
|
+
The first version organizes installation, data preparation, a conceptual model comparison, existing runnable tutorials, capabilities, and contributor guidance. Complete API documentation, longer posterior tutorials, and versioned release documentation remain future work. The site follows `main`; it does not currently offer a version selector.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source_commit": "67128c7a562cab67499bdc0604357731a628aa9e",
|
|
3
|
+
"platform": "Darwin arm64",
|
|
4
|
+
"python": "3.12.13",
|
|
5
|
+
"versions": {
|
|
6
|
+
"numpy": "2.5.3",
|
|
7
|
+
"scipy": "1.18.1",
|
|
8
|
+
"scikit-learn": "1.9.1",
|
|
9
|
+
"jax": "0.11.2",
|
|
10
|
+
"jaxlib": "0.11.2",
|
|
11
|
+
"numpyro": "0.22.0",
|
|
12
|
+
"arviz": "1.3.0"
|
|
13
|
+
},
|
|
14
|
+
"model_tests": {
|
|
15
|
+
"unique_passed": 1519,
|
|
16
|
+
"core_passed": 251,
|
|
17
|
+
"bayesian_passed": 1268,
|
|
18
|
+
"failed": 0,
|
|
19
|
+
"skipped": 0,
|
|
20
|
+
"method": "Entire installed-wheel core/Bayesian directories, four local Bayesian file shards; the updated participant-workflow file was rerun in full after restoring one omitted test."
|
|
21
|
+
},
|
|
22
|
+
"implementation_modules": 79,
|
|
23
|
+
"installed_implementation_hashes_match": true,
|
|
24
|
+
"handoff_checks": {
|
|
25
|
+
"source_ast_and_import_equivalence": "Passed independent review, allowing Ruff formatting/import ordering and two optional-extra error messages.",
|
|
26
|
+
"fresh_fit_parity": "Exact R objective history/loadings/predictions and GP MAP/posterior/update numeric arrays and statistical diagnostics on matched synthetic inputs. Elapsed-time telemetry and derived fit/evidence IDs excluded from fresh-fit comparison.",
|
|
27
|
+
"old_gp_archive_schemas": [
|
|
28
|
+
1,
|
|
29
|
+
2,
|
|
30
|
+
3,
|
|
31
|
+
4
|
|
32
|
+
],
|
|
33
|
+
"old_gp_archive_replay": "Exact retained arrays/configuration/diagnostics and available query moments; calibrated predictions and seeded posterior joint paths also match. No refitting during replay.",
|
|
34
|
+
"wheel_and_sdist_examples": "R fit/prediction/calibration and GP MAP/save/load passed from isolated installed artifacts.",
|
|
35
|
+
"base_only": "All 251 core tests passed with JAX/NumPyro absent.",
|
|
36
|
+
"review": "One omitted public posterior-participant test and its independent SciPy oracle restored; scoped re-review cleared the finding."
|
|
37
|
+
},
|
|
38
|
+
"limits": [
|
|
39
|
+
"No new scientific convergence, response-recovery or uncertainty-calibration study.",
|
|
40
|
+
"Historical R joblib and warmup checkpoints require their original environment; no compatibility unpickler or checkpoint identity bypass.",
|
|
41
|
+
"Hosted destination CI results must be checked on the pull request. No package release or upload performed."
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
Use Python 3.12 or later. Python 3.12 is the version currently exercised by package CI. Install version `0.1.0` from PyPI, or use a source checkout for development and the example scripts.
|
|
4
|
+
|
|
5
|
+
## Install the release
|
|
6
|
+
|
|
7
|
+
Create and activate a dedicated environment, then install the base model:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
python3.12 -m venv .venv
|
|
11
|
+
source .venv/bin/activate
|
|
12
|
+
python -m pip install "multimodalsrm==0.1.0"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For GP-MSRM, add the Bayesian extra:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m pip install "multimodalsrm[bayesian]==0.1.0"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
On Windows PowerShell, activate with `.venv\Scripts\Activate.ps1`. The following examples require a source checkout because the scripts are not installed as commands.
|
|
22
|
+
|
|
23
|
+
## Source checkout and R-MSRM example
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
git clone https://github.com/ljchang/multimodalsrm.git
|
|
27
|
+
cd multimodalsrm
|
|
28
|
+
git checkout v0.1.0
|
|
29
|
+
python3.12 -m venv .venv
|
|
30
|
+
source .venv/bin/activate
|
|
31
|
+
python -m pip install -e .
|
|
32
|
+
python examples/r_quickstart.py
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The activation command above is for macOS/Linux shells. On Windows PowerShell, activate with `.venv\Scripts\Activate.ps1`.
|
|
36
|
+
|
|
37
|
+
The base package provides the regularized model and shared data/response types:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from multimodalsrm import MultimodalSRM, TimeSeries, Identity, Gaussian, Response
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## GP-MSRM example
|
|
44
|
+
|
|
45
|
+
Install the optional Bayesian dependencies into the same environment:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
python -m pip install -e '.[bayesian]'
|
|
49
|
+
JAX_ENABLE_X64=true JAX_PLATFORM_NAME=cpu python examples/gp_map_quickstart.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
In PowerShell, set `$env:JAX_ENABLE_X64="true"` and `$env:JAX_PLATFORM_NAME="cpu"` before running the script. Float64 must be enabled before fitting. The Bayesian extra installs the numerical runtime used by the package; the base R installation does not require JAX or NumPyro.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from multimodalsrm.bayesian import BayesianMultimodalSRM, BayesianPriors
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The GP quickstart performs MAP fitting and archive replay. It does not run posterior sampling. Read [capabilities](capabilities.md) before selecting a sampling or computational backend.
|
|
59
|
+
|
|
60
|
+
## Record the version you use
|
|
61
|
+
|
|
62
|
+
An editable installation follows changes in your checkout. For a research analysis, record the source commit (`git rev-parse HEAD`), model configuration, random seed, and dependency versions. Keep the original environment for replaying historical fitted artifacts.
|
|
63
|
+
|
|
64
|
+
Continue with [data preparation](data.md) and the [runnable tutorials](tutorials.md).
|