Skip to content

Commit 8c57548

Browse files
authored
Update 504_batch_normalization.ipynb
Found 2 Errors that does not activate in Colab
1 parent 57aaef8 commit 8c57548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorial-contents-notebooks/504_batch_normalization.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"test_x = Variable(torch.from_numpy(test_x).float(), volatile=True) # not for computing gradients\n",
9797
"test_y = Variable(torch.from_numpy(test_y).float(), volatile=True)\n",
9898
"\n",
99-
"train_dataset = Data.TensorDataset(data_tensor=train_x, target_tensor=train_y)\n",
99+
"train_dataset = Data.TensorDataset(train_x, train_y)\n",
100100
"train_loader = Data.DataLoader(dataset=train_dataset, batch_size=BATCH_SIZE, shuffle=True, num_workers=2,)\n",
101101
"\n",
102102
"# show data\n",
@@ -274,7 +274,7 @@
274274
" for net, l in zip(nets, losses):\n",
275275
" net.eval() # set eval mode to fix moving_mean and moving_var\n",
276276
" pred, layer_input, pre_act = net(test_x)\n",
277-
" l.append(loss_func(pred, test_y).data[0])\n",
277+
" l.append(loss_func(pred, test_y).data)\n",
278278
" layer_inputs.append(layer_input)\n",
279279
" pre_acts.append(pre_act)\n",
280280
" net.train() # free moving_mean and moving_var\n",

0 commit comments

Comments
 (0)