Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d053113

Browse files
fixed for windows
1 parent f2ebd8a commit d053113

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎tutorial-contents/305_batch_train.py‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@
2424
num_workers=2, # subprocesses for loading data
2525
)
2626

27-
for epoch in range(3): # train entire dataset 3 times
28-
for step, (batch_x, batch_y) in enumerate(loader): # for each training step
29-
# train your data...
30-
print('Epoch: ', epoch, '| Step: ', step, '| batch x: ',
31-
batch_x.numpy(), '| batch y: ', batch_y.numpy())
27+
28+
def show_batch():
29+
for epoch in range(3): # train entire dataset 3 times
30+
for step, (batch_x, batch_y) in enumerate(loader): # for each training step
31+
# train your data...
32+
print('Epoch: ', epoch, '| Step: ', step, '| batch x: ',
33+
batch_x.numpy(), '| batch y: ', batch_y.numpy())
34+
35+
36+
if __name__ == '__main__':
37+
show_batch()
38+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /