mirror of
https://github.com/autistic-symposium/tensorflow-for-deep-learning-py.git
synced 2025-05-10 18:54:57 -04:00
7 lines
No EOL
305 B
Python
7 lines
No EOL
305 B
Python
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 |