From 15703d34cbc7b80ba9e3df50dd0042080e7f61aa Mon Sep 17 00:00:00 2001 From: Pierre Kreitmann Date: Tue, 26 May 2015 23:13:14 -0700 Subject: [PATCH] Add missing 'self' in code snippet Fix typo: add the missing "self" argument in a python method, in a code snippet. --- neural-networks-1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neural-networks-1.md b/neural-networks-1.md index 1d159e15..5aff4282 100644 --- a/neural-networks-1.md +++ b/neural-networks-1.md @@ -38,7 +38,7 @@ An example code for forward-propagating a single neuron might look as follows: ```python class Neuron: # ... - def forward(inputs): + 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