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

There is a training loop in the trainer which return loss and accuracy for the last batch #1

Open
burlachenkok opened this issue Oct 2, 2021 · 1 comment

Comments

@burlachenkok
Copy link

return losses[-1], accs[-1]

I understand that we for save of computing power measure accuracy and loss via moving model, but it may be the case that current implementation that just returns last loss and last acc in the last batch a bit incorrect.

I suggest replace it:
``` sum(losses)/len(losses), sum(accs)/len(accs)``

It's still approximate computation of loss and accuracy because we evaluate acc and loss in different points.

@universome
Copy link
Collaborator

To be honest, this design choice feels subjective. In the current implementation, we return a noisy estimate of the final training loss / final training accuracy of the episode. In your case, you propose to return the average training loss / average training accuracy. Since at the beginning of each episode the model has random performance, such measure would be polluted with bad scores received at the beginning of the training — especially if num_train_steps_per_episode is small (as in our case). For me, evaluating a model's performance based on its final performance feels more natural, but you can use whatever measure you are comfortable with

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

2 participants