- Lightweight Tanh neural network
- Includes a callback funtion that returns weights and bias of all nodes inside the model
npm i @issacto/simple-neural-network
var NeuralNetwork = require('@issacto/simple-neural-network').NeuralNetwork;
//first index is the input size
//last index, the output layer, should always equal one
var network = new NeuralNetwork([3,3,3,1])
- Default counter value for bias and weights initilization values are 0.5.
- Change it by adding the corresponding paraemters
//Counter value for bias is 0.6
//Counter value for weight is 0.7
var network = new NeuralNetwork([input_size,...,1], 0.6, 0.7)
trainInputs =[[1,0,0],[1,1,1],[1,0,1],[1,1,0],[2,1,0],[1,1,0]]
trainOutputs =[0,1,1,0,0,0]
var epoch = 100
var learningRate =0.1
network.train(trainInputs,trainOutputs, epoch,learningRate)
var errors = network.getErrors()
predictInput =[[1,0,0]]
var prediction = network.predict(testInputs)
var weights = network.getWeights()
var bias = network.getBias()