Skip to content

Commit

Permalink
Add comment about python list initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Samuel committed May 19, 2014
1 parent 869d656 commit ab685fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocr/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def train(self, training_data_array):
y2 = self.sigmoid(y2)

# Step 3: Back propagation
actual_vals = [0] * 10
actual_vals = [0] * 10 # actual_vals is a python list for easy initialization and is later turned into an np matrix (2 lines down).
actual_vals[data['label']] = 1
output_errors = np.mat(actual_vals).T - np.mat(y2)
hiddenErrors = np.multiply(np.dot(np.mat(self.theta2).T, output_errors), self.sigmoid_prime(sum1))
Expand Down

0 comments on commit ab685fe

Please sign in to comment.