Unified dimensionality reduction and neural network analysis framework
Project description
. . .
. .. . . .. . . .
. . . . .. . . --> . .. . --> λ(·)
. .. . . . . . .
. . .
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file manylatents-0.1.5.tar.gz.
File metadata
- Download URL: manylatents-0.1.5.tar.gz
- Upload date:
- Size: 509.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
725d3e5bf32586a0d19614c6615d21d0203765e840972f5e22c74cb4ce12a2c9
|
|
| MD5 |
4ee20e045de3f8fc6aef2d1813e91c14
|
|
| BLAKE2b-256 |
0d8bb0c8c147bd553e7c24494bdde7bbd680fbc0423f8ad5648f4928e9cda00b
|
Provenance
The following attestation bundles were made for manylatents-0.1.5.tar.gz:
Publisher:
publish.yml on latent-reasoning-works/manylatents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manylatents-0.1.5.tar.gz -
Subject digest:
725d3e5bf32586a0d19614c6615d21d0203765e840972f5e22c74cb4ce12a2c9 - Sigstore transparency entry: 1228534561
- Sigstore integration time:
-
Permalink:
latent-reasoning-works/manylatents@cddc05f5a21c0f9587ca3cac6c67a9883f0a7e75 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/latent-reasoning-works
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cddc05f5a21c0f9587ca3cac6c67a9883f0a7e75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file manylatents-0.1.5-py3-none-any.whl.
File metadata
- Download URL: manylatents-0.1.5-py3-none-any.whl
- Upload date:
- Size: 355.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
200367977e17e5a2b9203fdc4153dc5fe8a4664636382153d3876d50b8e175aa
|
|
| MD5 |
52628a997d79f14cc8ed00d5245b023f
|
|
| BLAKE2b-256 |
a4b6e0d1f579ad86fe8d041adc7980a5f4782a8f2ff41833b49524c2d703f717
|
Provenance
The following attestation bundles were made for manylatents-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on latent-reasoning-works/manylatents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
manylatents-0.1.5-py3-none-any.whl -
Subject digest:
200367977e17e5a2b9203fdc4153dc5fe8a4664636382153d3876d50b8e175aa - Sigstore transparency entry: 1228534576
- Sigstore integration time:
-
Permalink:
latent-reasoning-works/manylatents@cddc05f5a21c0f9587ca3cac6c67a9883f0a7e75 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/latent-reasoning-works
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cddc05f5a21c0f9587ca3cac6c67a9883f0a7e75 -
Trigger Event:
push
-
Statement type: