Self-consistency metrics for representational stability analysis
Project description
Shesha
Self-consistency metrics for representational stability analysis.
Shesha measures the geometric stability of high-dimensional representations by quantifying the self-consistency of their pairwise distance structure (RDMs) under controlled internal perturbations.
Full documentation at shesha-geometry.readthedocs.io
Installation
pip install shesha-geometry
Quick Start
import numpy as np
import shesha
X = np.random.randn(500, 768) # (n_samples, n_features)
stability = shesha.feature_split(X, n_splits=30, seed=320)
print(f"Feature-split stability: {stability:.3f}")
For the full API reference, installation guide, and usage examples, see the documentation.
Tutorials
Explore shesha with these interactive notebooks (each takes < 5 minutes to run):
LLM Embeddings - Analyze embedding stability across layers and models using
feature_split.Steering Vectors - Compute steering vectors from contrastive pairs and measure their consistency.
Vision Models - Compare geometric stability across ResNets, ViTs, and other architectures.
Representational Drift - Measure drift from Gaussian noise injection and LoRA fine-tuning.
Training Dynamics - Track geometric stability during training to detect representation collapse.
CRISPR (Bio) - Use
shesha.bioto analyze stability in single-cell CRISPR perturbation experiments.
Citation
If you use shesha-geometry, please cite:
@software{shesha2026,
title = {Shesha: Self-Consistency Metrics for Representational Stability},
author = {Raju, Prashant C.},
year = {2026},
howpublished = {Zenodo},
doi = {10.5281/zenodo.18227453},
url = {https://doi.org/10.5281/zenodo.18227453},
copyright = {MIT License}
}
@article{raju2026geometric,
title = {Geometric Stability: The Missing Axis of Representations},
author = {Raju, Prashant C.},
journal = {arXiv preprint arXiv:2601.09173},
year = {2026}
}
If you use the supervised variants (supervised_alignment, lda_stability, variance_ratio, class_separation_ratio), please also cite:
@article{raju2026canary,
title = {The Geometric Canary: Predicting Steerability and Detecting Drift via Representational Stability},
author = {Raju, Prashant C.},
journal = {arXiv preprint arXiv:2604.17698},
year = {2026}
}
If you use the shesha.bio module, please also cite:
@article{raju2026crispr,
title = {Geometric Coherence of Single-Cell CRISPR Perturbations Reveals Regulatory Architecture and Predicts Cellular Stress},
author = {Raju, Prashant C.},
journal = {arXiv preprint arXiv:2604.16642},
year = {2026}
}
License
MIT
Logo generated by Nano Banana Pro
Project details
Release history Release notifications | RSS feed
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 shesha_geometry-0.2.20.tar.gz.
File metadata
- Download URL: shesha_geometry-0.2.20.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8cc84f8a87e71a2c483415a7b56c2976c1040e6f2d69299a4f2b85ca33e8fa8
|
|
| MD5 |
faf111f083af0adc5851da0075eb8f95
|
|
| BLAKE2b-256 |
e74061f8fdcec0d6e504e495f9e24dcf5737611a48a07c3a0b85ba05d2ee020b
|
File details
Details for the file shesha_geometry-0.2.20-py3-none-any.whl.
File metadata
- Download URL: shesha_geometry-0.2.20-py3-none-any.whl
- Upload date:
- Size: 47.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4a30660f6e2cc23f7e16648bcb75792941403ce4bcb8a1f02ad841d5370fe0f
|
|
| MD5 |
acc329f5d9f0233085331e084ef1a82d
|
|
| BLAKE2b-256 |
72efab7e49249c93f702fecf139dd54ae0dbf89673494eeb628c6acbf707029d
|