Skip to main content
     .  . .
  .  .. . . ..       .  . .
 . . .  . .. . . -->  . .. .  -->  λ(·)
  . ..  . .  .       .  . .
    .  . .

        m a n y l a t e n t s

  one geometry, learned through many latents

license python uv PyPI


install

uv add manylatents

Optional extras:

uv add manylatents[hf]         # HuggingFace trainer
uv add manylatents[torchdr]    # GPU-accelerated DR via TorchDR
uv add manylatents[jax]        # JAX backend (diffrax)
uv add manylatents[all]        # everything
pip also works
pip install manylatents

quickstart

# embed a swiss roll with UMAP
manylatents algorithms/latent=umap data=swissroll

# add metrics
manylatents algorithms/latent=umap data=swissroll \
  metrics=trustworthiness

# sweep algorithms
manylatents --multirun \
  algorithms/latent=umap,phate,tsne \
  data=swissroll metrics=trustworthiness
development install
git clone https://github.com/latent-reasoning-works/manylatents.git
cd manylatents && uv sync
from manylatents.api import run

result = run(data="swissroll", algorithm="pca", metrics=["trustworthiness"])

embeddings = result["embeddings"]   # (n, d) ndarray
scores     = result["scores"]       # {"trustworthiness": 0.95}

# chain: PCA 50d -> PHATE 2d
result2 = run(input_data=result["embeddings"], algorithm="phate")

architecture

  CLI                         API
  manylatents ...             run(data=, algorithm=, ...)
       │                           │
       ▼                           ▼
  ┌─────────┐               ┌───────────┐
  │ main.py │               │  api.py   │
  │ Hydra   │               │ registries│
  └────┬────┘               └─────┬─────┘
       │    instantiate objects    │
       └──────────┬───────────────┘
                  ▼
        ┌──────────────────┐      ┌────────────────┐
        │  experiment.py   │─────►│  evaluate.py   │
        │  run_experiment()│      │  evaluate()    │
        │                  │      │  prewarm_cache │
        │  LatentModule    │      │  compute_knn   │
        │    fit/transform │      │  metric_fn(    │
        │  LightningModule │      │   cache=cache) │
        │    trainer.fit   │      └────────────────┘
        └──────────────────┘

Two base classes, one decision rule:

if the algorithm... use interface
has no training loop LatentModule fit(x) / transform(x)
trains with backprop LightningModule trainer.fit() / encode(x)

Both produce LatentOutputs — a dict keyed by "embeddings". All metrics receive a shared cache dict for deduplicated kNN and eigenvalue computation.


algorithms

17 algorithms -- 12 latent modules, 5 lightning modules

PCA, t-SNE, UMAP, PHATE, DiffusionMap, MDS, MultiscalePHATE, Merging, Classifier, Leiden, ReebGraph, SelectiveCorrection, Autoencoder, AANet, LatentODE, HF Trainer, Reconstruction AE.

neighborhood_size=k sweeps kNN uniformly across algorithms.


metrics

20+ metrics across three evaluation contexts

Embedding fidelity (trustworthiness, continuity, kNN preservation), spectral analysis (affinity spectrum, spectral decay rate), topological features (persistent homology), and dataset properties (stratification).

All metrics share a cache dict for deduplicated kNN computation. List-valued parameters expand via flatten_and_unroll_metrics() -- one kNN computation covers the entire sweep.

Config pattern: metrics=<name> (each metric config has an at: field for evaluation context)


data

6 synthetic manifolds + precomputed loader

Swiss roll, torus, saddle surface, gaussian blobs, DLA tree, and custom .npy/.npz files. Domain-specific datasets (genomics, single-cell) available via extensions.


citing

If manylatents was useful in your research, a citation goes a long way:

@software{manylatents2026,
  title     = {manyLatents: Unified Dimensionality Reduction and Neural Network Analysis},
  author    = {Valdez C{\'o}rdova, C{\'e}sar Miguel and Scicluna, Matthew and Ni, Shuang},
  year      = {2026},
  url       = {https://github.com/latent-reasoning-works/manylatents},
  license   = {MIT}
}



MIT License · Latent Reasoning Works

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manylatents-0.1.7.tar.gz (725.0 kB view details)

Uploaded Source

Built Distribution

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

manylatents-0.1.7-py3-none-any.whl (482.1 kB view details)

Uploaded Python 3

File details

Details for the file manylatents-0.1.7.tar.gz.

File metadata

  • Download URL: manylatents-0.1.7.tar.gz
  • Upload date:
  • Size: 725.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for manylatents-0.1.7.tar.gz
Algorithm Hash digest
SHA256 b3867d345000695719c5a106b78234e801fab1a812f94368a4db80cbc424308d
MD5 6a27632056cc052353b00922c0cbfd88
BLAKE2b-256 65245c5d7089201e82d631831100b36303995853b6b61669a183ba56f80d02e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for manylatents-0.1.7.tar.gz:

Publisher: publish.yml on latent-reasoning-works/manylatents

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

File details

Details for the file manylatents-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: manylatents-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 482.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for manylatents-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b6505db7f09b7bf650d38d93bcd096ac41f08fad5d4ab2b6f52dc6cbff6a463a
MD5 793e4877b13794fdb6f775d10098c1e0
BLAKE2b-256 b020e9353100c7764a59bcbc004c558c9a0ed3192f028cc1dc5a6bf646435ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for manylatents-0.1.7-py3-none-any.whl:

Publisher: publish.yml on latent-reasoning-works/manylatents

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

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page