Giter Site home page Giter Site logo

simplenn's Introduction

SimpleNN

Simple arbitrary neural network builder and feeder without learning function for arduino. Implement trained neural network into your project.

For use you need:

  • Predefined biases
  • Predefined weights
  • Neural network structure
  • Activation function

Features

  • User custom activation function

How to define neural network in SimpleNN library

The given example is in the 'examples' folder.

Neural network scheme

  1. Define weights:
float weights[] = {
  W0,   W1,
  W2,   W3,
  W4,   W5,
  
  W6,   W7,   W8,   W9,
  W10,  W11,  W12,  W13
}
  1. Define biases for each node (except nodes on first layer):
float biases[] = {
  B20, B21, B30, B31, B32, B33
}
  1. Define neural network structure (number of nodes on each layer):
unsigned int NNStructure[] = {
  3, 2, 4
}
  1. Define your activation function (for example Rely function):
float fRely(float x){ 
  return x > 0 ? x : 0;
}
  1. Define neural network:
SimpleNN NeuralNetwork( NNStructure, 3, &fRely, weights, biases);

Feedforward:

Reading sensors (just for the example. You are free to use your values as you want), normalizing values from 0.0f to 1.0f by dividing them by 1023, because we know, that values from analog input range between 0 and 1023. Then reading the output. Output is index of maximum value in output layer.

float input[3];
int state;
input[0] = analogRead(L_EYE) / 1023.0f;
input[1] = analogRead(R_EYE) / 1023.0f;
input[2] = analogRead(LD) / 1023.0f;
state = NeuralNetwork.feedForward(input);
Serial.println(state);

simplenn's People

Contributors

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