1.0.1 • Published 4 years ago

aneron v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

logo

Mouludin - Aneron v1.0.0 (Beta)

Minimalist neural network library for machine learning & deep learning in Javascript

Getting started

Node.JS

If using on node.js you need to install via npm in your terminal / command prompt.

  $ npm i aneron

Embeded HTML

  <script src="https://cdn.jsdelivr.net/npm/aneron@1.0.0/aneron.min.js"></script>

How to use this library?

if you use node.js you need to import it first

  let Ane = require('aneron')

Example XOR problem

Determine the layers:

example

 let ac = Ane.ac
 let model = new Ane([2],[2,ac.sigmoid],[1,ac.sigmoid])

You can give more than 3 layers. it depends on how much you need. Note: minimum is 3 layers

I have provided some activation functions that you can use:

  • sigmoid (Range = (0,1))
Ane.ac.sigmoid
  • hyperbolic tangent / tanh (Range = (-1,1))
Ane.ac.tanh
  • softsign (Range = (-1,1))
Ane.ac.softsign

Training data:

table

  // DATASET
  // input 
  let xs = [[0,0],[0,1],[1,1],[1,0]]
  //output
  let ys = [[0],[1],[0],[1]]
  
  // epochs is the entire processing by the learning algorithm of the entire train-set.
  model.fit(xs,ys,{epochs:10000})

Note: the greater the number of epohcs. the smaller errors you get

Prediction:

 console.log(model.predict([0,0]))
 console.log(model.predict([0,1]))
 console.log(model.predict([1,1]))
 console.log(model.predict([1,0]))

Output:

[ 0.014714430876991562 ]
[ 0.9852129041526403 ]
[ 0.018262319885759194 ]
[ 0.985212848886903 ]

that is a simple example of using this library

Authors

  • Muhammad Mauludin Anwar - Initial work - mouludin

License

This project is licensed under the terms of the MIT license, see LICENSE.

1.0.1

4 years ago

1.0.0

4 years ago