GithubHelp home page GithubHelp logo

nnjs's Introduction

nn.js : high performance (not yet) neural networks for the Browser

This package is in all respects inferior to convnet.js

This package is not meant to replace the excellent convnet.js,
but provide a lower-level package.

A fast low-level javascript package for multi-threaded neural net layers for the browser.

For now, this package only implements the forward ops, and does not implement backward.

It is useful when porting Torch models to the browser.

For example, it powers the browser demo in: http://soumith.ch/eyescream

Layers:

nn.SpatialConvolution(weight, bias, padH, padW) 
nn.SpatialMaxPooling(kH, kW, dH, dW)
nn.ReLU()
nn.Linear(weight, bias)
nn.View(shape)
nn.Sequential()
nn.JoinTable(dim)
nn.ParallelTable()
nn.Identity()

###Uses:

  • [TODO] Web workers for using multiple cores
  • [TODO] SIMD optimizations if the browser supports SIMD.js or WebAssembly

###Dependencies:

  • ndarray
  • ndarray-fill
  • msgpack-js

###Unit tests:

Unit tests can be run via nodejs.

$ npm -g install mocha
$ cd nnjs
$ mocha 

  SpatialConvolution
      ✓ Should compare against torch convolutions (126ms)

  SpatialMaxPooling
      ✓ Should compare against torch SpatialMaxPooling

  Linear
      ✓ Should compare against torch Linear layer

  Loader
      ✓ Should load a full multi-layer model and compare against torch result (3051ms)


  4 passing (3s)

Building for the browser

npm install -g browserify
browserify -r ./js/init.js:nn -r ndarray -r ndarray-fill -o static/js/nn.js

nnjs's People

Contributors

soumith avatar

Stargazers

 avatar  avatar Zhou Chang avatar MonKey Lee avatar Tianqi Chen avatar Edgar Simo-Serra avatar Brendan Shillingford avatar Mazen Abdullah avatar Jiwon Kim avatar  avatar Kashif Rasul avatar Sébastien Arnaud avatar Taehoon Kim avatar Erfan Noury avatar Kai Arulkumaran avatar Gideon Wulfsohn avatar

Watchers

James Cloos avatar Marat Dukhan avatar  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.