Sovereign 8s.is mirror of standardgalactic/MRAE
  • Jupyter Notebook 92%
  • Python 8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Erica Busch 5ba7729f1c Initial release v0.1
Manifold Regularized Autoencoder (MRAE) and multi-subject variant (MRMDAE)
for learning shared low-dimensional manifolds from fMRI timeseries data.
Includes pip packaging, example notebooks, and Sherlock dataset.
2026-03-05 12:22:18 -05:00
MRAE Initial release v0.1 2026-03-05 12:22:18 -05:00
.gitignore Initial release v0.1 2026-03-05 12:22:18 -05:00
image.png Initial release v0.1 2026-03-05 12:22:18 -05:00
pyproject.toml Initial release v0.1 2026-03-05 12:22:18 -05:00
README.md Initial release v0.1 2026-03-05 12:22:18 -05:00
requirements.txt Initial release v0.1 2026-03-05 12:22:18 -05:00
setup.cfg Initial release v0.1 2026-03-05 12:22:18 -05:00
setup.py Initial release v0.1 2026-03-05 12:22:18 -05:00

Manifold Regularized Autoencoder (MRAE)

Quick Start

MRAE learns a shared low-dimensional manifold from fMRI timeseries data using a manifold-regularized autoencoder. A pre-computed embedding (e.g., from PHATE, TPHATE, or PCA) is used to regularize the autoencoder's bottleneck, aligning its latent space with the target manifold geometry.

MRMDAE is a variant of a MRAE that allows for multi-subject alignment. It is a type of network with a single encoder, which learns to jointly encode all subjects timeseries data together (granted they are temporally aligned), and reconstruct the data in subject-space through multiple decoders. See architecture here:

alt text

Based on: https://arxiv.org/abs/2201.00622

Note that PHATE/TPHATE etc are not required for installing this package. Please install separately with pip if needed. They will be needed to run the example notebooks.

Single-subject (MRAE)

import mrae
from mrae import ManifoldRegularizedAutoencoder
from mrae.dataHandler import LoadVolumeAndEmbedDataset_single

# Load data and pre-computed manifold embedding
dataset = LoadVolumeAndEmbedDataset_single(data, embedding)

# Initialize and train
model = ManifoldRegularizedAutoencoder(
    hidden_dim=64,
    manifold_dim=10,
    IO_dim=dataset.get_voxel_dims()[0],
)
model.train(dataset)

# Project new data onto learned manifold
projections = model.extract_projection_to_manifold(new_data)

Multi-subject (MRMDAE)

from mrae import MRMDAE
from mrae.dataHandler import LoadVolumeAndEmbedDataset_multi

dataset = LoadVolumeAndEmbedDataset_multi(data_paths, embed_paths, TRs)

model = MRMDAE(
    hidden_dim=64,
    manifold_dim=10,
    IO_dim=dataset.get_voxel_dims()[0],
    n_decoders=n_subjects,
)
model.train(dataset)

Installation

pip install mrae

Or install from source:

git clone https://github.com/ericabusch/MRAE
cd MRAE
pip install -e .

Erica L. Busch, Yale University, Feb 2026