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.

Can not change learning rate after initialization

See original GitHub issue

#5536 # System information

  • **OS Platform and Distribution : Ubuntu 18.04
  • Ray installed from (source or binary): binary
  • Ray version: 0.7.3
  • Python version: 3.6.8
  • Exact command to reproduce:

I’m trying to change learning rate of policies in training loop,

while True
      rest=trainer.train()
     #here I want to change learning rate based on environment statistics

I tried to use reset_config function, but it doesn’t work

def gen_policy(GENV,lr):
    config = {
        "model": {
            "custom_model": 'GomokuModel',
            "custom_options": {"use_symmetry": True, "reg_loss": 0},
        },
        "cur_lr":lr,
        "custom_action_dist": Categorical,
    }
    return (None, GENV.observation_space, GENV.action_space, config)

new_config = trainer.get_config()
new_config['multi_agent']['policy_0']=gen_policy(GENV,0.0123)
resss=trainer.reset_config(new_config)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
yarik1988commented, Sep 2, 2019

It seems the best choice is do such way if you want to change some hyper-parameters

state = trainer.save()
trainer.stop()
#re_initialise trainer
trainer.restore(state)
2reactions
kiddyboots216commented, Sep 2, 2019

Hi, can you try this? I’ve been able to change the LR of a PPO policy in this manner. Keep in mind that the policy you’re using almost certainly has an LR schedule, so that’s why I end up setting the schedule with the value that I want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learning rate doesn't change for AdamOptimizer in ...
I was asking myself the exact same question, and wondering why wouldn't it change. By looking at the original paper (page 2), one...
Read more >
How to Configure the Learning Rate When Training Deep ...
In this tutorial, you will discover the learning rate hyperparameter used when training deep learning neural networks. After completing this ...
Read more >
How to Choose a Learning Rate Scheduler for Neural ...
Constant learning rate: as the name suggests, we initialize a learning rate and don't change it during training;; Learning rate decay: we ...
Read more >
Setting the learning rate of your neural network. - Jeremy Jordan
If your learning rate is set too low, training will progress very slowly as you are making very tiny updates to the weights...
Read more >
MATLAB trainingOptions
If you do not specify validation data, then the function does not display this field. Base Learning Rate, Base learning rate. The software...
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