Skip to content

Commit 060a5c4

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

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

examples/basic_tutorials/tutorial_cifar10_cnn_static.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,15 @@ def _map_fn_test(img, target):
155155

156156
for epoch in range(n_epoch):
157157
start_time = time.time()
158-
159158
train_loss, train_acc, n_iter = 0, 0, 0
160159
for X_batch, y_batch in train_ds:
161160
net.train()
162-
163161
with tf.GradientTape() as tape:
164162
# compute outputs
165163
_logits = net(X_batch)
166164
# compute loss and update model
167165
_loss_ce = tl.cost.cross_entropy(_logits, y_batch, name='train_loss')
168166
_loss_L2 = 0
169-
# for p in tl.layers.get_variables_with_name('relu/W', True, True):
170-
# _loss_L2 += tl.cost.lo_regularizer(1.0)(p)
171167
_loss = _loss_ce + _loss_L2
172168

173169
grad = tape.gradient(_loss, train_weights)

0 commit comments

Comments
 (0)