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

[PyTorch] Use reduction=none for train_epoch_ch3 #2007

Merged
merged 1 commit into from Jan 13, 2022

Conversation

AnirudhDagar
Copy link
Member

@AnirudhDagar AnirudhDagar commented Jan 13, 2022

Description of changes:
Fixes loss not showing up in the following sections:

I'll look at other sections that might be affected. Note that l.mean() is required otherwise when using l.sum() with PyTorch CrossEntropy (with no reduction) the loss overshoots. This change will not affect any other notebooks because d2l.train_ch3 is only used in these notebooks, so it won't break any other section.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

@mli
Copy link
Member

mli commented Jan 13, 2022

Job d2l-en/PR-2007/1 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-2007/

@astonzhang astonzhang merged commit de59626 into d2l-ai:r0.17 Jan 13, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants