kartben / NeuralNetworks

Nothing "Import ant", just a simple library for implementing Neural-Networks(NNs) easily and effectively on any Arduino board and other microcontrollers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple MLP - NeuralNetwork Library For Microcontrollers

Nothing "Import ant", just a simple library for implementing Neural-Networks(NNs) easily and effectively on any Arduino board and other microcontrollers.

Summary

NN Functions Input Type (x) Output Type (Y) Action
*FeedForword(X) 1D Float Array 1D Float Array "Feeds" the NN with X-input values and returns Y-Output Values, If needed.
*BackProp(x) 1D Float Array 1D Float Array Tells to the NN if the outputs-Y were right/the-expected-X-inputs and then, teaches it.

Examples: Backpropagation_Single_Xor_Gate.ino
Understanding the Basics of a Neural Network:
0 1 2 3 4 5 6 7 8 9 10 11 12 .
An Image that Explains some basic things.

Features

Important

  • ATtiny85 doesn't have FPU that makes Maths on it, "difficult" for the SRAM
  • If you want to Use "Serial" On An ATtiny85 Click Here (Be Careful SoftwareSerial Uses A lot of SRAM)
  • If you have Error with 'POINTER_REGS' Click Here
  • Backprop maths on An ATtiny85 doesn't work properly for some reasons, though Feed Forword maths Work! [...]
  • I am not yet a professional programmer [...]

Tested On

  • Arduino Uno
  • ATtiny85

Examples

* Example Files (.ino) Explenation
1 Backpropagation_double_Xor NeuralNetwork Training of a 3-input-xor circuit and the print of the output(s) of it
2 Backpropagation_Single_Xor_Gate NeuralNetwork Training of a xor gate and the print of the output(s) of it
3 FeedForward_double_Xor print of the outputs of the pre-trained-NN
4 FeedForward_double_Xor_PROGMEM print of the outputs of the pre-trained-NN using weights and biases from ROM

Functions & Variables [...]

NN = NeuralNetwork , LR = Learning Rate

NN Functions Input Type (x),(z) Output Type (Y) Action
*FeedForword(*inputs) 1D Float Array 1D Float Array "Feeds" the NN with X-input values and returns Y-Output Values, If needed.
*FeedForword(*inputs, IS_PROGMEM) 1D Float Array, Boolean 1D Float Array "Feeds" the NN with X-input values and returns Y-Output Values, If needed. [Weights And Biases Saved in ROM]
BackProp(*expected) 1D Float Array 1D Float Array Tells to the NN if the outputs-Y were right/the-expected-X-inputs and then, teaches it.
print(IS__PROGMEM) Boolean String Serial.Prints the weights and biases of NN. If print(true) prints from ROM
NN.Layer[ i ].Sigmoid(&x) Constant Float Float Returns Sigmoid Activation Function's 1/(1+e^(-x)) value
NN -Constructors -Variables -Layer's Variables Type Explenation
NeuralNetwork(*_layer, &NumberOflayers) const unsigned int, Constructor
NeuralNetwork(*_layer, &NumberOflayers, &LRw, &LRb) const unsigned int, ,const float, Constructor
NeuralNetwork(*_layer, *default_Weights, *default_Bias, &NumberOflayers) const unsigned int,float , ,const unsigned int Constructor
NeuralNetwork(*_layer, *default_Weights, *default_Bias, &NumberOflayers,NO_OUTPUTS) const unsigned int,float , ,const unsigned int,bool Constructor NO_OUTPUTS Clears Outputs from RAM
NN.LearningRateOfWeights float -
NN.LearningRateOfBiases float -
NN.layers[ i ] Layer* -
NN.Layer[ i ].bias float* -
NN.Layer[ i ].outputs[ j ] float* -
NN.Layer[ i ].weights[ j ][ l ] float** -
NN.Layer[ i ].preLgamma[ j ] float* -
NN.layers[ i ]._numberOfInputs unsigned int ReadOnly
NN.layers[ i ]._numberOfOutputs unsigned int ReadOnly

Searches Across Internet

| | Intresting |NN.| Neural Network(s) |A.| Arduino etc. |-| Mostly .NET & Other |*| Maybe Intresting?

NNs PROGMEM Define directive Other & "Random"
Playlist Arduino Tutorial A. Initialize Array Values
Playlist Manual Arduino Define A. Inheritance,destructors?
BackPropagation Examples Determining board A. Identifying Arduino type?
Math Chain Rule + Post define extern? A. Create compile error?
Getting Started + Pointers .ino Determining Board A. Measuring Memory Usage
+ BackProp Tutorial + Double Info Understanding #if ? A. External Memory
+ BackProp Tutorial read-only? Random Defined Site? A. ATtiny85 Math Issues?
+ Complete NN chart ! flash to RAM? Loading local libraries? A. Attiny85 External Mem.?
+ MIT Deep RL Info Near Far? A. Splitting Array?
+ MIT Deep Learning Example A. Importing Loads Everything?
- .NET Framework What is PGM_P? NN. Backprop. For Dummies YT
- .NET ! 1,2,3,4,5,6 Passing Array? NN. Convolutional (Math- code)
- C# Implementation, 2 Passing Array? NN. In 4 minutes - Python
- .NET Deep NN Reading? NN. Quick Intro
* Predicting Languages Easy data handling? NN. -
* MIT Recurrent NNs Reading Long? NN. PyConSG 2016
- 2007 .NET Img Recognition Multi-D Array? NN. Simple 9 lines of Py-code
- C# Handwritten Recognition Attiny85 mem? NN. MIT Press book
Youtube Chanel Prob Array use? NN. A Beginner's Guide
+ Recurrent Explained Double or float? NN. MIT courses?
- .NET 1,2,3 NN.Back Propagation
- C# Handwritten Recognition NN. MLP Maths?
+ Python NN From Scratch NN. Math. Notations Into Code
* How Backpropagation! NN. Maths Into Code
linear Regression NN. (TAA),(BDI) Architecture
+ MLP NN. fast.ai ?
+ MLP NN. deeplearning.net
🇬🇷 Νευρωνικά Δίκτυα NN. BackProp Python
🇬🇷 Γενετικός Αλγόριθμος NN. C# Code
- MS NN Classification NN. Implement BackProp Python
- VB ML Q-Learning NN. Java Tut Playlist ?
* handwritten Recognition NN. BackProp for Dummies
* Deep Learning in 6 weeks? NN. Wiki Backprop Math
* Playlist NN. Looking Inside
- SciBasic

Notes

Forgive me for my mistakes and maybe poor knowledge in C/C++, but it is also my first time making a "normal" library [...]
I am also sorry for my randomness in some parts of the Searches Across Internet Section.

Εικόνα που βλέπει το "εγώ", θυμίζει κουτί που δε βλέπεις, εικόνα που χάνεις• σκιά που 'τε φως και να βλέπεις, ακούει τα λόγια που λες: [...] ‮#i📁👁

I wish love and happiness to Everyone! <3

Donation

  • Donate
  • Bitcoin Address: 1Cfn2zb2XC5JAqTNjDYAxwKYVwtjqcf5Pm

About

Nothing "Import ant", just a simple library for implementing Neural-Networks(NNs) easily and effectively on any Arduino board and other microcontrollers.

License:Other


Languages

Language:C++ 100.0%