Skip to content

Conversation

@mnhng
Copy link

@mnhng mnhng commented Jan 13, 2018

Fix #4648
In Python 2, the division operation in self.last_epoch / self.T_max is integer division, resulting in incorrect result. Switch the order of evaluation so that the division is true division.

@apaszke
Copy link
Contributor

apaszke commented Jan 13, 2018

@pytorchbot test this please

@soumith
Copy link
Contributor

soumith commented Jan 14, 2018

tests are failing:

AssertionError: LR is wrong in epoch 1: expected 0.05, got 0.0487764129098

@soumith
Copy link
Contributor

soumith commented Jan 14, 2018

@pytorchbot test this please

@apaszke apaszke merged commit 188ee3f into pytorch:master Jan 14, 2018
@apaszke
Copy link
Contributor

apaszke commented Jan 14, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in CosineAnnealingLR in Python 2 (?)

4 participants