Skip to content

Commit c5ce8ff

Browse files
committed
Fix typo in mlp.txt
The example code to compute the cost of the linear combination of L1 and L2 regularization penalties didn't match the code below. They referred to variables `L1` and `L2`, which should actually be `classifier.L1` and `classifier.L2`.
1 parent 509b7c4 commit c5ce8ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/mlp.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ The code that computes the new cost is:
289289
# the model plus the regularization terms (L1 and L2); cost is expressed
290290
# here symbolically
291291
cost = classifier.negative_log_likelihood(y) \
292-
+ L1_reg * L1 \
293-
+ L2_reg * L2_sqr
292+
+ L1_reg * classifier.L1 \
293+
+ L2_reg * classifier.L2_sqr
294294

295295

296296
We then update the parameters of the model using the gradient. This code is

0 commit comments

Comments
 (0)