jiexunsee / Neural-Network-with-Python

A neural network with 3 layers made with just numpy as dependency
26 stars 31 forks source link

can be use with integer/float > 1 ? #2

Open ryzenX opened 6 years ago

ryzenX commented 6 years ago

Hello, it's possible to use your neural network for addition of integer/float with result > 1 ? like this :

training_set_inputs = array([[2,1],[3,2],[1,4],[4,3],[2,4]])
training_set_outputs = array([[3,5,5,7,6]]).T

when i search 1+3: neural_network.forward_pass(array([1,3]))

i have in output 0.99, what do I have to change in the code to do that?

jiexunsee commented 6 years ago

the output is squashed to be between 0 and 1, because of the sigmoid function at the end. As such, this network in its current form only predicts a class label of 0 or 1. You'd need to remove the sigmoid function at the end, and tweak the backpropagation if you want to use it to do addition.