OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Mlp Mixer Pytorch

Mlp Mixer Pytorch is a Python library implementing MLP-Mixer-style vision models in PyTorch, with model classes for image and video classification.

Independent OpenViST project profile, based on linked sources.

Mlp Mixer Pytorch — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a PyTorch project needs an MLP-Mixer-style classifier and the model dimensions can be configured for its image or video input.

Who it is for

  • PyTorch developers adding an MLP-based image classifier to an application or experiment.
  • Researchers or developers prototyping classification on rectangular images or video tensors.

Documented uses

  • Configure an image-classification model with chosen image dimensions and class count.
  • Generate class predictions from square or rectangular image tensors.
  • Configure a 3D model for video inputs and generate class predictions.
Before you choose

Requirements & limits

The repository is public and lists an MIT license. The README documents installation through pip.

  • The library exposes separate MLPMixer and MLPMixer3D classes for image and video inputs.
  • The documented image examples support both square and rectangular dimensions.
  • Model configuration includes patch size, dimension, depth and number of classes; video configuration also includes temporal size and patching.
  • The README demonstrates prediction calls but does not document training or pretrained weights.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Create an image classifier and obtain predictions

Install the package, configure an MLPMixer for square or rectangular image input, and call it on a PyTorch tensor.

Before you start

  • Python environment with PyTorch available.
  • Install the package with pip install mlp-mixer-pytorch.

Steps

  1. Import torch and MLPMixer from mlp_mixer_pytorch.

  2. Configure MLPMixer with image size, channels, patch size, dimension, depth and number of classes.

  3. Create an input tensor matching the configured image dimensions and call the model with that tensor.

Expected outcome

The example returns a prediction tensor whose final dimension corresponds to the configured number of classes.

Guide limitations

  • The documented example uses a randomly generated tensor, not a dataset or trained-model workflow.
Source-based practical guide

Configure a video classifier and obtain predictions

Install the package, configure MLPMixer3D for video dimensions, and call it on a PyTorch video tensor.

Before you start

  • Python environment with PyTorch available.
  • Install the package with pip install mlp-mixer-pytorch.

Steps

  1. Import torch and MLPMixer3D from mlp_mixer_pytorch.

  2. Set image size, time size, time patch size, channels, patch size, dimension, depth and number of classes.

  3. Create a video tensor matching the documented channel, time, height and width dimensions, then call the model.

Expected outcome

The example returns a prediction tensor with one class-score vector per input batch item.

Guide limitations

  • The documented example uses a randomly generated tensor; it does not describe data preparation, training or evaluation.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
4 November 2026
Original website title
lucidrains/mlp-mixer-pytorch · Official homepage title · retained in its source language