Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def feedForward(self, training_example):
- #The values calculated during forward propagation are
- #stored to be used during backpropagation
- #Extract activations for first layer from training_example list
- self.a1 = np.array((training_example[0][0],training_example[0][1]))
- #Calculate the weighted inputs and activations for all other layers in the network
- self.z2 = np.dot(self.W1, self.a1.reshape(-1,1))
- self.a2 = self.sigmoid(self.z2)
- self.z3 = np.dot(self.W2, self.a2)
- self.a3 = self.sigmoid(self.z3)
- #return the activations of the neuron in the output layer
- return self.a3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement