Git Product home page Git Product logo

bifrost's Introduction

Bifrost

Bifrost translates models in PyTorch into SpiNNaker executables.

It is named after Bifrost, the bridge between middle earth and the realms of the gods in Norse mythology.

Usage: PyTorch -> PyNN script

After training the model, when saving the StateDictionary you need to use the utility set_parameter_buffers included in bifrost.extract.torch.parameter_buffers. To load the model again, the torch.nn.Module method load_state_dict has to have the argument strict set to False.

Models are encoded by providing the Python import path to the model class as well as the shape of input tensor (here with 1 timestep, 8 batches, 2 channels, and a 640x480 image input):

bifrost model.SNNModel "(1, 8, 2, 640, 480)" > output.py

Usage: Execute PyNN script with weights file

The output can now be evaluated with a specific set of parameter values from a PyTorch Lightning checkpoint file. Note that the command must run inside a SpiNNaker-friendly environment (see below):

python output.py weights.ckpt 

By "SpiNNaker-friendly environment" we mean a working installation of sPyNNaker and access to a SpiNNaker machine. See the attached Dockerfile for a quick environment installation.

Credits

Bifrost is maintained by

The project is indebted to the work by Petrut A. Bogdan on JSON conversions from ANN to SNN and to Simon Davidson for advice and supervision.

The work has received funding from the EC Horizon 2020 Framework Programme under Grant Agreements 785907 and 945539 (HBP)

License

LGPLv3. See LICENSE for license details.

bifrost's People

Contributors

chanokin avatar jegp 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.