Skip to content

ericabusch/MRAE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Manifold Regularized Autoencoder for fMRI timeseries data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors