Skip to main content
ToolPotion
AI Advisor
Submit a Tool (Free)

PyTorch MADE

This repository provides a PyTorch implementation of MADE (Masked Autoencoder Density Estimation). It enables turning auto-encoders into autoregressive density models by masking connections in MLPs. The code allows for efficient likelihood evaluation and sampling, with examples for binarized MNIST.

View Repository
Share
View Repository
Share

This GitHub repository, `karpathy/pytorch-made`, offers a concise implementation of MADE (Masked Autoencoder Density Estimation) using PyTorch. The core concept behind MADE is to transform a standard auto-encoder into an autoregressive density model. This is achieved by strategically masking connections within a Multi-Layer Perceptron (MLP) and by ordering the input dimensions. Crucially, the model ensures that each output dimension depends only on input dimensions that appear earlier in the defined order.

Read More

Similar to other autoregressive models like char-rnn and pixel cnns, MADE facilitates very efficient likelihood evaluation, requiring only a single forward pass through the network. However, the process of sampling new data points is linear with respect to the number of dimensions. The original paper's implementation, while functional, was noted for its verbosity and reliance on Theano. This PyTorch version aims for simplicity and clarity, with the core logic contained in approximately 150 lines of code.

The repository includes examples demonstrating how to use the MADE model, particularly with the binarized MNIST dataset. Users can reproduce results from the original paper, such as training a 1-layer MLP to achieve a binary cross-entropy loss of 94.5. The examples also illustrate how to train larger model ensembles, leveraging weight sharing within a single MLP and averaging predictions at test time for improved performance, achieving a test loss of 79.3 with 10 orderings.

The primary class, `MADE`, is implemented in `made.py` and inherits from PyTorch's `nn.Module`, making it easy to integrate into larger neural network architectures. The instantiation process involves specifying input and output dimensions, hidden layer sizes, and the number of masks to use. The output dimension parameter is flexible, allowing for various output distributions such as Gaussian or binned softmax predictions. The simplest case, as demonstrated with binary predictions for MNIST, uses a single output parameter per input dimension.

  • CategoryAI Models & LLMs
  • Pricing ModelOpen source
  • DeploymentCloud, Self-hosted
  • PlatformsWeb

  • Implementation of Masked Autoencoder Density Estimation (MADE)

  • Built using PyTorch for ease of integration

  • Enables autoregressive density modeling

  • Efficient likelihood evaluation via single forward pass

  • Linear sampling complexity with respect to dimensions

  • Includes examples for binarized MNIST dataset

  • Supports training of model ensembles

  • Flexible output layer for various distributions

  • Concise codebase (~150 lines for core logic)

  • Masking of MLP connections for autoregression

  • Input dimension ordering for conditional dependencies

  1. Access model: Clone the GitHub repository.

  2. Set up environment: Install PyTorch and other dependencies.

  3. Integrate via API: Instantiate the `MADE` class from `made.py`.

  4. Configure model: Specify input/output dimensions, hidden layers, and number of masks.

  5. Train model: Use `run.py` script with specified dataset and parameters.

  6. Evaluate likelihood: Perform a single forward pass.

  7. Sample data: Execute sampling process linearly with dimensions.

  • Density Estimation
  • Autoregressive Modeling
  • Image Generation
  • Probabilistic Modeling
  • Machine Learning Research
  • Data Compression

PyTorch MADE Reviews

Loading...

Popular AI Tools Like PyTorch MADE

V-JEPA

AI GitHub Repos

V-JEPA is a PyTorch implementation for self-supervised learning from video. It utilizes a joint-embedding predictive architecture to learn visual representations without human…

AI Models & LLMs
View Tool

AI GitHub Repos

PyTorch implementation for self-supervised learning from video. It utilizes a joint-embedding predictive architecture to learn visual representations without human…V-JEPA is a PyTorch implementation for self-supervised learning from video. It utilizes a joint-embedding predictive architecture to learn visual representations without human…

AI Models & LLMs
See the Top 250 AI GitHub Repos

SqueezeNet is a deep convolutional neural network model available through PyTorch. It achieves AlexNet-level accuracy with significantly fewer parameters and a smaller model size,…

AI Models & LLMs
View Tool

Deep convolutional neural network model available through PyTorch. It achieves AlexNet-level accuracy with significantly fewer parameters and a smaller model size,…SqueezeNet is a deep convolutional neural network model available through PyTorch. It achieves AlexNet-level accuracy with significantly fewer parameters and a smaller model size,…

AI Models & LLMs
See the Top 5 AI Models

Pythae

AI GitHub Repos

Pythae offers a unified platform for Variational Autoencoder (VAE) implementations using Pytorch. It provides researchers and developers with a comprehensive toolkit to experiment…

Machine Learning Platforms
View Tool

AI GitHub Repos

Offers a unified platform for Variational Autoencoder (VAE) implementations using Pytorch. It provides researchers and developers with a comprehensive toolkit to experiment…Pythae offers a unified platform for Variational Autoencoder (VAE) implementations using Pytorch. It provides researchers and developers with a comprehensive toolkit to experiment…

Machine Learning Platforms
See the Top 250 AI GitHub Repos

Funnel-Transformer

AI GitHub Repos

Funnel-Transformer is an AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…

AI Models & LLMs
View Tool

AI GitHub Repos

AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…Funnel-Transformer is an AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…

AI Models & LLMs
See the Top 250 AI GitHub Repos

StyleGAN-XL

AI GitHub Repos

StyleGAN-XL is an AI model for generating high-resolution images from large, diverse datasets. It scales StyleGAN architecture for improved image synthesis quality and diversity.…

AI Models & LLMs
View Tool

AI GitHub Repos

AI model for generating high-resolution images from large, diverse datasets. It scales StyleGAN architecture for improved image synthesis quality and diversity.…StyleGAN-XL is an AI model for generating high-resolution images from large, diverse datasets. It scales StyleGAN architecture for improved image synthesis quality and diversity.…

AI Models & LLMs
See the Top 250 AI GitHub Repos

This GitHub repository provides the official implementation for the NeurIPS 2021 paper 'Revisiting Deep Learning Models for Tabular Data.' It explores deep learning architectures…

AI Models & LLMs
View Tool

PyTorch

AI GitHub Repos

PyTorch is an open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.

Machine Learning & Data Science
View Tool

AI GitHub Repos

Open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.PyTorch is an open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.

FeaturedMachine Learning & Data Science
See the Top 250 AI GitHub Repos

ConvMixer

AI GitHub Repos

This repository provides an implementation of ConvMixer, a convolutional neural network architecture for image recognition tasks. It is based on the paper "Patches Are All You…

AI Models & LLMs
View Tool

AI GitHub Repos

This repository provides an implementation of ConvMixer, a convolutional neural network architecture for image recognition tasks. It is based on the paper "Patches Are All You…

AI Models & LLMs
See the Top 250 AI GitHub Repos
1 of 8