GithubHelp home page GithubHelp logo

Comments (2)

mpyrozhok avatar mpyrozhok commented on May 23, 2024

Hello, @uyekt
I've refactored scheduler a little bit. max_lr could be adjusted by directly specifying it as a parameter for optimizer, base_lr equivalent is min_lr parameter. Maximum lr scaling and lr policies are implemented using callable objects to allow saving scheduler state between runs.

  • parameter eta_on_restart_cb=ReduceMaxLROnRestart(ratio=0.5)) will enable scaling max lr by ratio on each restart. ratio=0.5 will decrease max lr by half.
  • parameter eta_on_iteration_cb=ExpReduceMaxLROnIteration(gamma=0.99999)) will enable scaling max lr exponentially on every iteration.
  • you can create your own scaling policy by writing a callable object or lambda function and passing it as a parameter. eta_on_restart_cb accepts functions that adjust eta on every restart, eta_on_iteration_cb executes scaler function on every iteration.

The only thing that comes to mind concerning your diverging model without knowing details is that your lr is too high. Does your model converge with constant lr?

from adamwr.

uyekt avatar uyekt commented on May 23, 2024

Hi @mpyrozhok,

Thanks a lot! Seems to work like a charm!
It converges with constant LR and with triangular too, but sometimes with triangular it diverges on a restart. (loss suddenly around 12 times highers and it doesn't recover)

I am training a CARN for SISR with L1 Loss and AdamW. I tried using L1-Charbonnier and it doesn't start to diverge anymore after the cosine restart. It seems it has something to do with the loss.
I will have to do more tests this week.

from adamwr.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.