jorgenkg / python-neural-network

This is an efficient implementation of a fully connected neural network in NumPy. The network can be trained by a variety of learning algorithms: backpropagation, resilient backpropagation and scaled conjugate gradient learning. The network has been developed with PYPY in mind.
BSD 2-Clause "Simplified" License
297 stars 98 forks source link

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

Closed ryzenX closed 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?

jorgenkg commented 6 years ago

Yes. However, you cannot use an activation function that squashes the output signal to the interval [0,1] in the output layer like eg. the sigmoidal activation function does.

Maybe the ReLU activation function will work for your application.