This commit is contained in:
Marina von Steinkirch 2016-08-14 15:58:23 -07:00
parent da1b22cf4a
commit db89b720d8
13 changed files with 2873 additions and 0 deletions

7
Numpy/neuron.py Normal file
View file

@ -0,0 +1,7 @@
class Neuron(object):
# ...
def forward(inputs):
""" assume inputs and weights are 1-D numpy arrays and bias is a number """
cell_body_sum = np.sum(inputs * self.weights) + self.bias
firing_rate = 1.0 / (1.0 + math.exp(-cell_body_sum)) # sigmoid activation function
return firing_rate