Metadata-Version: 2.4
Name: lanfactory
Version: 0.9.0
Summary: Package with convenience functions to train LANs
Author-email: Alexander Fengler <alexander_fengler@brown.edu>, Carlos Paniagua <carlos_paniagua@brown.edu>, Hannah Hafner <hhafner@smith.edu>
License: MIT License
        
        Copyright (c) 2021 Alexander Fengler
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/lnccbrown/LANFactory
Project-URL: Documentation, https://lnccbrown.github.io/LANfactory/
Project-URL: Bug Tracker, https://github.com/lnccbrown/LANFactory/issues
Keywords: LANs,generative models,cognitive science,neuroscience,sbi
Classifier: Development Status :: 1 - Planning
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Requires-Python: <3.15,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ssm-simulators>=0.15.0
Requires-Dist: scipy>=1.15.2
Requires-Dist: pandas>=2.2.3
Requires-Dist: torch>=2.10.0
Requires-Dist: flax>=0.12.7
Requires-Dist: tqdm>=4.67.1
Requires-Dist: frozendict>=2.4.6
Requires-Dist: onnx>=1.17.0
Requires-Dist: jax2onnx<0.18,>=0.15
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: plotly>=6.0.0
Requires-Dist: seaborn>=0.13.2
Requires-Dist: typer>=0.9.0
Provides-Extra: mlflow
Requires-Dist: mlflow>=3.14.0; extra == "mlflow"
Provides-Extra: hf
Requires-Dist: huggingface-hub>=0.20.0; extra == "hf"
Provides-Extra: sbi
Requires-Dist: sbi>=0.26; extra == "sbi"
Requires-Dist: nflows>=0.14; extra == "sbi"
Provides-Extra: bayesflow
Requires-Dist: bayesflow>=2.0.8; extra == "bayesflow"
Requires-Dist: keras>=3.12; extra == "bayesflow"
Provides-Extra: all
Requires-Dist: mlflow>=3.14.0; extra == "all"
Requires-Dist: huggingface-hub>=0.20.0; extra == "all"
Requires-Dist: sbi>=0.26; extra == "all"
Requires-Dist: nflows>=0.14; extra == "all"
Requires-Dist: bayesflow>=2.0.8; extra == "all"
Requires-Dist: keras>=3.12; extra == "all"
Dynamic: license-file

<div style="position: relative; width: 100%;">
  <img src="docs/images/mainlogo.png" alt="LANfactory" style="width: 175px;">
  <a href="https://ccbs.carney.brown.edu/brainstorm" style="position: absolute; right: 0; top: 50%; transform: translateY(-50%);">
    <img src="docs/images/Brain-Bolt-%2B-Circuits.gif" alt="Brown Brainstorm" style="width: 100px;">
  </a>
</div>

# LANfactory

[![DOI](https://zenodo.org/badge/386076271.svg)](https://doi.org/10.5281/zenodo.17137303)
![PyPI](https://img.shields.io/pypi/v/lanfactory)
![PyPI downloads](https://img.shields.io/pypi/dm/lanfactory)
[![Run tests](https://github.com/lnccbrown/LANfactory/actions/workflows/run_tests.yml/badge.svg)](https://github.com/lnccbrown/LANfactory/actions/workflows/run_tests.yml)
[![codecov](https://codecov.io/gh/lnccbrown/LANfactory/branch/main/graph/badge.svg)](https://codecov.io/gh/lnccbrown/LANfactory)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

LANfactory trains likelihood approximation networks (LANs), choice probability
networks (CPNs), and option probability networks (OPNs) with PyTorch or
JAX/Flax. It exports concrete-shape ONNX artifacts for use as likelihoods in
[HSSM](https://lnccbrown.github.io/HSSM/).

[Documentation](https://lnccbrown.github.io/LANfactory/) ·
[Start with the PyTorch tutorial](https://lnccbrown.github.io/LANfactory/basic_tutorial/basic_tutorial_lan_torch/) ·
[API reference](https://lnccbrown.github.io/LANfactory/api/trainers/) ·
[HSSM ecosystem map](https://lnccbrown.github.io/HSSM/ecosystem/)

## Install

```bash
pip install lanfactory
```

Optional integrations are available through the `mlflow`, `hf`, `sbi`, and
`bayesflow` extras, or together through `lanfactory[all]`. The documentation is
the canonical source for training, export, configuration, and sharing guidance.

## Contributor bootstrap

Install the development environment and run the package gates:

```bash
uv sync --all-groups
uv run pytest tests/
uv run ruff check src/lanfactory
uv run ruff format --check .
```

Build or serve the documentation through the repository-owned entry point:

```bash
./scripts/docs.sh build
./scripts/docs.sh serve
```

Notebook execution remains a separate package test workflow; the documentation
build renders the committed notebook outputs without executing them.

## Citation

Use the archived LANfactory release DOI:
[10.5281/zenodo.17137303](https://doi.org/10.5281/zenodo.17137303).
