From ce193ecfd45a25f606c05011ef7707a735f8b77a Mon Sep 17 00:00:00 2001 From: forsythd Date: Wed, 29 Jul 2015 16:12:10 -0400 Subject: [PATCH] Add num_examples variable --- neural-networks-case-study.md | 1 + 1 file changed, 1 insertion(+) diff --git a/neural-networks-case-study.md b/neural-networks-case-study.md index aa9246aa..fe3924cc 100644 --- a/neural-networks-case-study.md +++ b/neural-networks-case-study.md @@ -96,6 +96,7 @@ $$ Given the array of `scores` we've computed above, we can compute the loss. First, the way to obtain the probabilities is straight forward: ```python +num_examples = X.shape[0] # get unnormalized probabilities exp_scores = np.exp(scores) # normalize them for each example