Skip to content

Commit 8aecec6

Browse files
author
Mofan Zhou
committed
update theano TUT
1 parent b4b22cf commit 8aecec6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

theanoTUT/theano12_regularization/full_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def minmax_normalization(data):
5050

5151
# the way to compute cost
5252
cost = T.mean(T.square(l2.outputs - y)) # without regularization
53-
# cost = T.mean(T.square(l2.outputs - y)) + 0.1 * (l1.W ** 2).sum() + (l2.W ** 2).sum() # with l2 regularization
54-
# cost = T.mean(T.square(l2.outputs - y)) + 0.1 * abs(l1.W).sum() + abs(l2.W).sum() # with l1 regularization
53+
# cost = T.mean(T.square(l2.outputs - y)) + 0.1 * ((l1.W ** 2).sum() + (l2.W ** 2).sum()) # with l2 regularization
54+
# cost = T.mean(T.square(l2.outputs - y)) + 0.1 * (abs(l1.W).sum() + abs(l2.W).sum()) # with l1 regularization
5555
gW1, gb1, gW2, gb2 = T.grad(cost, [l1.W, l1.b, l2.W, l2.b])
5656

5757
learning_rate = 0.01

0 commit comments

Comments
 (0)