Git Product home page Git Product logo

mlp-mixer's Introduction

mlp-mixer

This is my attempt to implement the MLP-mixer model as described in this paper: https://arxiv.org/pdf/2105.01601v1.pdf

Based on the code of what seems to be the original implementation: https://github.com/google-research/vision_transformer/blob/master/vit_jax/models_mixer.py

Usage

To install requirement for this project : conda env create -f environment.yml

Note: I think you only need Pytorch and maybe numpy to run this code. So I suggest you use your own environment and just install pytorch for GPU.

model = MlpMixer(image_input_size=img_size,
                     nb_channels=1,
                     patch_size=4,
                     nb_blocks=4,
                     out_size=10,
                     hidden_size=256,
                     dropout=0.1)

image_input_size and patch_size can be a tupple for 2D shape. nb_channels: is the number of the channel for the input. nb_blocks: is the number of mixer block in the model. out_size: The number of classes for the output of the model. hidden_size: The hidden size of the mixer block. dropout: The amount of dropout to use.

Install

Let's make it works

mlp-mixer's People

Contributors

therealmarvin avatar

Watchers

 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.