Coder Social home page Coder Social logo

neuroduino's Introduction

Neuroduino

An artificial neural network library for Arduino

Neuroduino is a two-layer perceptron network with a simplified API suitable for Arduino projects that need to flexibly associate an input pattern with an output pattern. See Neuroduino Example for a functioning example. This library was developed in 2010 at the Interactive Telecommunications Program for my thesis, The Dawn Chorus.

Example uses:

  • Simple clustering and classification (but not XOR until backpropagation is finished!)
  • 'Natural' language emergence (as in my thesis)
  • Conceivably, simple stabilization of servos or motors

Pull requests for bug fixes, improvements, documentation, etc are absolutely welcome!

Basic Usage

Setup

Neuroduino myNet;
int netArray[NUM_LAYERS] = {8,8};
int inputArray[] = {1, -1, 1, -1, -1, 1, -1, 1};    // The input to be trained to
int trainArray[] = {-1, 1, -1, -1, 1, -1, 1, -1};   // What you want the network to output when it gets the inputArray
myNet = Neuroduino(netArray, NUM_LAYERS, ETA, THETA, DEBUG);
  • NUM_LAYERS is currently fixed to 2. If anyone wants to finish implementing backpropagation, I would welcome your pull requests!
  • ETA is the learning rate: the amount each value changes on each iteration. Making this larger makes learning much faster, but can result in oscillations. Making it smaller does the opposite. 0.1 by default.
  • THETA is the activation threshold. This is 0.0 by default.
  • DEBUG turns on extra debugging output. False by default.

Set initial weights

srand(analogRead(0)); (or use a fixed integer for reproducible results)
myNet.randomizeWeights();

Run some iterations

printArray(myNet.simulate(inputArray), netArray[1]);

Eventually, the network should output trainArray when it gets inputArray. Yay! Why go through all this trouble? The association between input and output is flexible, so small 'imperfections' in the input should still produce the desired output.

neuroduino's People

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.