Code Monkey home page Code Monkey logo

brain's Introduction

Build Status

bnn-fpga

This repo contains Go implementation and corresponding APIs for acceleration of Binarized Neural Network (BNN) on FPGAs.

The current bnn package provides a set of functions for neural network processing including network constructors, inference, training and input data manipulation.

Notes

Implementation wise the following assumptions are made wrt the network (for now):

* neurons are considered to be fully connected (no sparsity).
* a bias matrix is to be considered along with the weight matrix.
* Initial weight (bias) distributions (aka normalization) are randomly defined.
* an input data set from [the UCI machine learning repo](http://archive.ics.uci.edu/ml/datasets)
* initial data alignment is to be done by the CPU and get loaded into the FPGA-visible memory space.
* the inference function is selected as the kernel (FPGA resident action).
* the design is checked by `reco check` to ensure it is synthesisable by our compiler.

Install

First off install the base package from GoLearn which is used for data augmentation etc.

   export GOPATH=`dir`
  
   uzip ./src/datasets/*.zip && rm ./src/datasets/*.zip 
   
   go get -t -u -v github.com/sjwhitworth/golearn/base

   go get -t -u -v github.com/reconfigureio/brain/bnn

   (Optional: utils package provides functions for loading datasets)
   go get -t -u -v github.com/reconfigureio/brain/utils

Getting Started

Examples

/examples dir contains two examples (inference and training) of implementing a neural network using Reconfigure.io's provided brain library. Each example is consist of cmd and kernel parts. It is usually a good practice to think in advance about partitioning your computation and data. In the current examples we have decided to locate data (incl. weight and bias), from training phase, on the host side (/cmd/main.go) so that we could apply pre-inference data augmentation, such as re formatting the entires from float to fixed.

for more information about implementing, simulating, and running kernels please refer to our documentation: http://docs.reconfigure.io/

Docs

[TODO] a list of Go features that our compiler dosen't support. http://docs.reconfigure.io/go_support.html

References

Daniel Whitenack, "Machine Learning With Go", Packt Publishing, September 2017 Data Set: Iris flower data set: https://en.wikipedia.org/wiki/Iris_flower_data_set

brain's People

Contributors

campgareth avatar mahdi89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

brain's Issues

using TensorFlow Go APIs

On using TF Go bindings I can think of two ways forward:

  • Mapping the entire constructed TF graph to our Teak dataflow (which is also closer to row stationary form).
  • Add custom new op to TF and have it registered as a new kernel. Our compiler takes care of mapping the kernel to Teak dataflow form.

Imo the former may require a clear understanding of the TF graphs but the latter sounds more viable as TF treats the new kernels as independent entities.

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.