GithubHelp home page GithubHelp logo

yinhefeng / grae Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinmoonlab/grae

0.0 0.0 0.0 23.43 MB

Geometry Regularized Autoencoders (GRAE) for large-scale visualization and manifold learning

Python 10.63% Jupyter Notebook 89.37%

grae's Introduction

Geometry Regularized Autoencoders (GRAE)

Teapot

Source code for the Geometry Regularized Autoencoder paper. Based on the paper here. The traditional autoencoder objective is augmented to regularize the latent space towards a manifold learning embedding, e.g., PHATE. A more detailed explanation of the method can be found in GRAE_poster.pdf.

Install

You can install this repo directly with pip, preferably in a virtual environment :

pip install --upgrade git+https://github.com/KevinMoonLab/GRAE.git

Character Tracking

Usage

The code largely follows the scikit-learn API to implement different autoencoders and dimensionality reduction tools. You can change basic autoencoder hyperparameters and manifold learning hyperparameters through the model interface. For example, to reproduce some Rotated Digits results :

from grae.models import GRAE
from grae.data import RotatedDigits

# Various autoencoder parameters can be changed
# t and knn are PHATE parameters, which are used to compute a target embedding
m = GRAE(epochs=100, n_components=2, lr=.0001, batch_size=128, t=50, knn=10)

# Input data should be an instance of grae.data.BaseDataset
# We already have subclasses for datasets in the paper
data = RotatedDigits(data_path='data', split='train')

# Fit model
m.fit(data)

# Get 2D latent coordinates
z = m.transform(data)

# Compute some image reconstructions
imgs = m.inverse_transform(z)

Some utility functions are available for visualization :

# Fit, transform and plot data
m.fit_plot(data)

# Transform and plot data
m.plot(data)

# Transform, inverse transform and visualize reconstructions
m.view_img_rec(data)

Most of our benchmarks are implemented with similar estimators. Implemented models include

  • GRAE: Autoencoder with a PHATE latent target;
  • GRAE (UMAP): Autoencoder with a UMAP latent target;
  • AE: Vanilla Autoencoder;
  • DAE: Denoising Autoencoder;
  • CAE: Contractive Autoencoder;
  • VAE: β-VAE;
  • TAE: Topological Autoencoder;
  • DiffusionNet: Diffusion Nets.

And many more!

Adding a new model or a new dataset

New models should subclass grae.models.BaseModel or grae.models.AE if autoencoder-based. New datasets should follow the grae.data.BaseDataset interface.

Reference

If you use this code, please cite the following:

A. Duque, S. Morin, G. Wolf, K.R. Moon, "Extendable and invertible manifold learning with geometry regularized autoencoders," IEEE International Conference on Big Data, pp. 5027-5036, Dec. 2020.

grae's People

Contributors

andresd45 avatar kmoon3 avatar sachamorin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.