Skip to main content

A repo for RRAEs in PyTorch.

Project description

RRAEsTorch

A library that offers same functions as RRAEs (originally in JAX) but in PyTorch.

MAIN DIFFERENCE: the number of samples (or batch) is the first dimension here (as usual in Torch) as opposed to the last dimension is the JAX version.

The RAEDME is copied from RRAEs in the following:

Welcome

This repository allows users to train and manipulate Equinox models easily, specifically, Autoencoders.

The library provides trainor classes that allow to train Neural Networks in one line using JAX.

It also provides easy ways to do normalization, and vectorization of matrices during training.

There are also pre-built Autoencoder models, specifically Rank Reduction Autoencoders (RRAEs).

What are RRAEs?

RRAEs or Rank reduction autoencoders are autoencoders include an SVD in the latent space to regularize the bottleneck.

This library presents all the required classes for creating customized RRAEs and training them (other architectures such as Vanilla AEs, IRMAEs and LoRAEs are also available).

Each script is an example of how to train a different model.

To simply train an MLP (from equinox), try this

To train an RRAE on curves (1D) using an MLP, refer to this file To train an RRAE on curves (1D) using an Convolutions, refer to this file To train an RRAE on images, refer to this file To train a VRRAE on images, refer to this file To train with an adaptive bottleneck size refer to this and [this] file(main-adap-CNN.py)

For examples of post-processing and what RRAE trainors can do, refer to this file

General instruction for preparing your own data

In RRAEs.utilities, there's a function called get_data that can import many datasets to test.

If you want to generate your own dataset, you will have to define the following:

x_train: Train input (refer to each script to see the shape)

x_test: Test input (refer to each script to see the shape)

p_train: None (if you don't have any parameters, otherwise, these can be used for interpolation in the latent space)

p_test: Same as p_train

y_train: = x_train for autoencoders

y_test: = x_test for autoencoders

pre_func_inp: lambda x:x (if not needed, this is a function to be applied on batches if memory is not enough to apply over whole dataset)

pre_func_out: lambda x:x (same as above but for output)

kwargs: {} (any other kwargs you might need)

Installation

pip install RRAEsTorch

Or to get the newest changes:

pip install git+https://github.com/JadM133/RRAEsTorch.git

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

rraestorch-0.1.11.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rraestorch-0.1.11-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file rraestorch-0.1.11.tar.gz.

File metadata

  • Download URL: rraestorch-0.1.11.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rraestorch-0.1.11.tar.gz
Algorithm Hash digest
SHA256 852d8cd780b9b351546858fe2c5f75c4f26b28910175ede25385261046855906
MD5 a411841800e15ab3684c3b17be566f7e
BLAKE2b-256 cb4bf12c61984fcc02a835781413a32bf6f9a222d8a1371850683be02d5e0774

See more details on using hashes here.

File details

Details for the file rraestorch-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: rraestorch-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rraestorch-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 05c5ceefcb9ccbeeba0c99ce420c5b99eeeb568719949d3c168b159de12379aa
MD5 50e363b32977666d4722960976dfebf9
BLAKE2b-256 e7cd24504652f2b751300609ef1f18071a04e7d108fdc868471e17d2b6e50bda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page