Skip to content

Conversation

@chandlerzuo
Copy link
Contributor

@chandlerzuo chandlerzuo commented Nov 15, 2018

Modified step_lr for StepLR, MultiStepLR, ExponentialLR and CosineAnnealingLR. In this way, multiple schedulers can be used simultaneously to modify the learning rates.

Related issue: #13022

Added unit tests combining multiple schedulers.

return [group['lr'] * self.gamma
for group in self.optimizer.param_groups]
# return [base_lr * self.gamma ** (self.last_epoch // self.step_size)
# for base_lr in self.base_lrs]

This comment was marked as off-topic.

This comment was marked as off-topic.

threshold=0.1, patience=5, cooldown=5)
self._test_reduce_lr_on_plateau(scheduler, targets, metrics, epochs)

def test_compound_step_and_multistep_lr(self):

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Nov 15, 2018

Don't forget to fix Python lint (see the Travis job.)

def get_lr(self):
return [base_lr * self.gamma ** (self.last_epoch // self.step_size)
for base_lr in self.base_lrs]
if (self.last_epoch == 0) or (self.last_epoch % self.step_size != 0):

This comment was marked as off-topic.

milestones = set(milestones)
#if not list(milestones) == sorted(milestones):
# raise ValueError('Milestones should be a list of'
# ' increasing integers. Got {}', milestones)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Nov 15, 2018

Changes LGTM.

@ezyang
Copy link
Contributor

ezyang commented Nov 15, 2018

Nit: When naming a PR, name it for what it does, not a URL (that you have to click through to find out what it's about ;)

@chandlerzuo chandlerzuo changed the title Fix issue https://github.com/pytorch/pytorch/issues/13022 Redefine scheduler to set learning rate using recursive formula Nov 15, 2018
@jeanm
Copy link

jeanm commented Dec 15, 2018

Is this blocked on something? Would be great to have it merged!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandlerzuo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandlerzuo is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandlerzuo is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

ezyang added a commit that referenced this pull request Apr 10, 2019
ezyang added a commit that referenced this pull request Apr 10, 2019
…la (#14010)"

This reverts commit 096ee84.

See #17913

gh-metadata: pytorch pytorch 19132 gh/ezyang/69/head
@vfdev-5 vfdev-5 mentioned this pull request Apr 27, 2019
ezyang added a commit that referenced this pull request Jun 4, 2019
…la (#14010)"

This reverts commit 096ee84.  It also
reverts some subsequent fixes.

Fixes #20527
vincentqb added a commit that referenced this pull request Jun 14, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 14, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 14, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 16, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter WIP"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 16, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 16, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 16, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 17, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 17, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 17, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 18, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 18, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 18, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
@ezyang ezyang added the merged label Jun 25, 2019
vincentqb added a commit that referenced this pull request Jun 27, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 27, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 28, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 28, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 28, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jun 28, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 1, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 1, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 1, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 1, 2019
…ing recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter"

Revert "Revert "Redefine scheduler to set learning rate using recursive formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 1, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.

gh-metadata: pytorch pytorch 21800 gh/vincentqb/6/head
vincentqb added a commit that referenced this pull request Jul 12, 2019
…ve formula" #14010 (#21463)" and enable closed form with non-sequential epoch parameter

This reverts commit 3889855.
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.

4 participants