Skip to content

Commit febe527

Browse files
authored
Update tutorial_cifar10_cnn_static.py
1 parent 060a5c4 commit febe527

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/basic_tutorials/tutorial_cifar10_cnn_static.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,9 @@ def _map_fn_test(img, target):
162162
# compute outputs
163163
_logits = net(X_batch)
164164
# compute loss and update model
165-
_loss_ce = tl.cost.cross_entropy(_logits, y_batch, name='train_loss')
166-
_loss_L2 = 0
167-
_loss = _loss_ce + _loss_L2
168-
165+
_loss = tl.cost.cross_entropy(_logits, y_batch, name='train_loss')
169166
grad = tape.gradient(_loss, train_weights)
170167
optimizer.apply_gradients(zip(grad, train_weights))
171-
172168
train_loss += _loss
173169
train_acc += np.mean(np.equal(np.argmax(_logits, 1), y_batch))
174170
n_iter += 1

0 commit comments

Comments
 (0)