Created
January 19, 2019 03:24
-
-
Save himanshuxd/892881c7733385aff61a17342ee59342 to your computer and use it in GitHub Desktop.
Forward Propagating Single Neuron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Neuron(object): | |
# ... | |
def forward(self, 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment