. . .
. .. . . .. . . .
. . . . .. . . --> . .. . --> λ(·)
. .. . . . . . .
. . .
m a n y l a t e n t s
one geometry, learned through many latents
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
Metadata
Release files for manylatents 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| manylatents-0.1.8.tar.gz | 747.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| manylatents-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / manylatents-0.1.8.tar.gz
| Download URL | manylatents-0.1.8.tar.gz |
|---|---|
| Size | 747.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8265125668f5c464c5bf9167459b460f0eface9baf2a9ab48c9e2730d5105d63
|
|
BLAKE2b-256 checksum How to use checksums |
a1f8e30d69f1b6240c56c925b72ed7c6a197a0424393d70b762c50d785d4c2f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / manylatents-0.1.8-py3-none-any.whl
| Download URL | manylatents-0.1.8-py3-none-any.whl |
|---|---|
| Size | 497.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d9bf995c48de0da32fbb1160f608268b737ebdbd2290cf75a5215e072260260
|
|
BLAKE2b-256 checksum How to use checksums |
625856aaeb28e174ce5ee4d64e9be0906717221d7e216e7d60d1c4f4cee0ea25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log