Code Monkey home page Code Monkey logo

pytorch-lmu's Introduction

PyTorch LMU

This repository contains PyTorch implementations of the following papers:

Performance on the psMNIST dataset is demonstrated in examples/.

Usage

torch, numpy, and scipy are the only requirements.
src/lmu.py contains the implementations of LMUCell, LMU and LMUFFT.

Examples:

  • LMU

    import torch
    from lmu import LMU
    
    model = LMU(
        input_size = 1,
        hidden_size = 212,
        memory_size = 256,
        theta = 784
    )
    
    x = torch.rand(100, 784, 1) # [batch_size, seq_len, input_size]
    output, (h_n, m_n) = model(x)
  • LMUFFT

    import torch
    from lmu import LMUFFT
    
    model = LMUFFT(
        input_size = 1,
        hidden_size = 346,
        memory_size = 468, 
        seq_len = 784, 
        theta = 784
    )
    
    x = torch.rand(100, 784, 1) # [batch_size, seq_len, input_size]
    output, h_n = model(x)

Running on psMNIST

  • Clone this repository and open:

    Running in Google Colab is preferred

  • examples/permutation.pt contains the permutation tensor used while creating the psMNIST data; it's included for reproducibility. Alternatively, torch.randperm(784) can be used to test with a new permutation.

References

pytorch-lmu's People

Contributors

hrshtv 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.