Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add train_batch and train methods #33

Open
masa-su opened this issue Oct 15, 2018 · 1 comment
Open

Add train_batch and train methods #33

masa-su opened this issue Oct 15, 2018 · 1 comment

Comments

@masa-su
Copy link
Owner

masa-su commented Oct 15, 2018

現在のtrainはbatchごとに受け取って計算する形になっているが,毎回外側でepochのiterationを書くのが面倒.そこで,従来のtrainをtrain_batchと変更し,イテレーターを受け取って1epoch分学習するtrainメソッドを実装する.

for epoch in range(1, epochs + 1):
    train_loss = model.train(train_loader)

testも同じ(pytorchにあわせて,testもevalに変更するかも)

@masa-su
Copy link
Owner Author

masa-su commented Oct 15, 2018

ただしtrainに引数を明示的に与えられないのが問題点.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant