question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Learning rate scheduler

See original GitHub issue

Hi, I noticed that with default configuration like:

optimizer = dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
lr_config = dict(        
    policy='step',       
    warmup='linear',     
    warmup_iters=500,    
    warmup_ratio=1.0 / 3,
    step=[16, 21])    

the learning rate will decrease to 1/10 when training reaches a plateau (several epochs/iters?). Now I want to change those settings, like in pytorch we have ‘patience’ or so. What is the api name for that ? Are there any documentation I can refer to? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

9reactions
leemengweicommented, Jun 27, 2019

In mmcv/runner/runner.py I saw hook_name = lr_config['policy'].title() + 'LrUpdaterHook' and in mmcv/mmcv/runner/hooks/lr_updater.py I saw things like class FixedLrUpdaterHook(LrUpdaterHook): and class StepLrUpdaterHook(LrUpdaterHook) Thus, learning rate planner in configuration file of mmd should be like lr_config = dict(
policy=‘step’, #Here, could alter to fixed, step, exp, poly, inv, cosine warmup=‘linear’,
warmup_iters=500,
warmup_ratio=1.0 / 3, step=[16, 21])

3reactions
ghostcommented, Jun 28, 2021

@rubeea Thanks. After reflection poly schedule seems to be able to help to find the optimal lr. You can fix indirectly start_lr and end_lr by fix min_lr in lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False), and your initial lr in your optimizer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learning Rate Schedules and Adaptive Learning Rate ...
Learning rate schedules seek to adjust the learning rate during training by reducing the learning rate according to a pre-defined schedule. Common learning...
Read more >
LearningRateScheduler - Keras
schedule: a function that takes an epoch index (integer, indexed from 0) and current learning rate (float) as inputs and returns a new...
Read more >
12.11. Learning Rate Scheduling - Dive into Deep Learning
More generally we want to define a scheduler. When invoked with the number of updates it returns the appropriate value of the learning...
Read more >
Using Learning Rate Schedules for Deep Learning Models in ...
Adapting the learning rate for your stochastic gradient descent optimization procedure can increase performance and reduce training time.
Read more >
LearningRateScheduler | Tensorflow ... - Analytics Vidhya
LearningRateScheduler is one of the callbacks in Keras API (Tensorflow). Callbacks are those utilities that are called during the training ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found