Code Monkey home page Code Monkey logo

utensor's Introduction

uTensor - Test Release

CircleCI

Release Note

  • Updated uTensor ReadMe
  • Updated uTensor-CLI ReadMe
  • Added Contributor Guide
  • Added new uTensor project guide
  • Dropout Support

Introduction

What is it?

uTensor is an extremely light-weight machine learning inference framework built on Mbed and Tensorflow. The project contains a runtime library and an offline tool. The total size of graph definition and algorithm implementation of a 3-layer MLP produced by uTensor is less than 32kB in the resulting binary (excluding the weights).

How does it work?

A model is constructed and trained in Tensorflow. uTensor takes the model and produces a .cpp and .hpp file. These files contains the generated C++11 code needed for inferencing. Working with uTensor on the embedded side is as easy as copy-and-paste. The function interface looks like this:

#include "models/deep_mlp.hpp"
...
Context ctx;  //creating a context
...
//preparing for the input tensor
...
get_deep_mlp_ctx(Context& ctx, Tensor* input_0);  //perform inference
ctx.eval();
S_TENSOR prediction = ctx.get({"y_pred:0"});  //getting the result

The .hpp and .cpp files can be generated given a model (protocal buffer) file, for example:

$ utensor-cli deep_mlp.pb --output-nodes=y_pred
...
... Generate header file: models/deep_mlp.hpp
... Generate source file: models/deep_mlp.cpp

What's supported?

The project is work-in-progress. Here are the operators, of their quantized versions, that are currently avaliable:

  • Add
  • ArgMax
  • Dropout
  • MatMal
  • Max
  • Min
  • Placeholder
  • Quantization Ops
  • ReLu
  • Reshape

Quick Start

Hardware

uTensor should support any Mbed enabled board that has sufficient memory (128+ kB RAM and 512kB+ flash recommended). However, these two boards are popular among the core developers:

  • DISCO-F413ZH: a good demo/application prototyping platform, wi-fi
  • K64F: rock-solid development environment

You will need a FAT32 formated SD card. Please note, the size of the SD card has to be less than 32GB. An SD card will be made optional in the future releases.

The Environment

There are two flows to get started with uTensor. For Windows users, please choose the Cloud9 flow as shown below.

  • The Cloud9 Flow
    • Requires Amazon Cloud9 Account
    • Does not support runtime debugging
  • Local Installation

The Examples

The example uses a 3-layer MLP trained on the MNIST dataset. The touch screen input is fed into the neural network for processing and the result is printed on the screen.

This example shows how to buffer time-series data into batches of snapshots. These snapshots are then fed into the neural network for inferencing. The model a small multi-layer MLP trained on the ADL dataset.

Creating a New Project

Please refer to this guide for instructions on creating your own project from stretch on DISCO-F413ZH.

Development

uTensor is young and under going rapid development. Many exciting features are on the way:

  • Convolution
  • Pooling
  • SD cards optional: ability to store weights in on-board flash
  • CMSIS-NN integration
  • Smaller binary

You can also check the project page for the latest progress. If you'd like to take part in this project, please have a look at our contributor guide and feel free to reach out to us.

Further Reading

utensor's People

Contributors

bityog avatar cmonr avatar dboyliao avatar janjongboom avatar jserv avatar knight-x avatar mbartling avatar metanav avatar neil-tan avatar

Watchers

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