Code Monkey home page Code Monkey logo

Comments (7)

bratao avatar bratao commented on June 23, 2024 4

Just an update @juntang-zhuang . Your modified Ranger got the best accuracy with half epochs compared to regular Ranger. It is already my favorite optimizer. Thank you!

from adabelief-optimizer.

juntang-zhuang avatar juntang-zhuang commented on June 23, 2024 1

Thanks for the feedback. I think you are right, and this might be caused by the fact that the update is roughly m_t / sqrt(. (gt-mt)^2 ), the denominator is sometimes too small. Even if the denominator is small for one element, that element will explode. This is a issue I'm trying to fix in the next release, for example hard thres 1/sqrt( (gt-mt)^2 ) to a rather large value.
Please keep this issue open as a reminder of problems to fix for improvement.

from adabelief-optimizer.

juntang-zhuang avatar juntang-zhuang commented on June 23, 2024

I noticed that the learning rate is quite large, after reduction it's still 3e-3. Perhaps a large lr also causes the instability.

from adabelief-optimizer.

juntang-zhuang avatar juntang-zhuang commented on June 23, 2024

Wow, excited to hear that, thanks so much for trying it out.

from adabelief-optimizer.

henriyl avatar henriyl commented on June 23, 2024

Could be entirely unrelated to this issue, but at first step in AdaBelief we havem_t = grad, causing v_t = 0 and step_size = step_size / epsilon_t which seems like unintended behaviour.

Edit2:
Deleted my earlier further comments as they were not exactly correct.

from adabelief-optimizer.

juntang-zhuang avatar juntang-zhuang commented on June 23, 2024

Thanks for comment @henriyl . The detailed implementation is definitely not perfect now and might suffer from numerical issues, and you refer to a very good point. For this paper, it's more like a "proof-of-idea" considering the key modification of Adam(W) is only 2 lines of code, therefore many details are not well solved (these details might not be a big problem for CV task but might be more serious in RNN with exploding or vanishing gradient). We are working on the improvement, both in implementation and on theory (personally I guess the convergence bound is too loose in the paper). Thanks again for pointing this out.

from adabelief-optimizer.

juntang-zhuang avatar juntang-zhuang commented on June 23, 2024

@bratao Just an update, I might confuse "gradient clip" with "gradient threshold" before, please see the discussion in readme.md. Perhaps "gradient clip" still helps, which shrinks vector amplitude but keeps the direction, but it might require different clip ranges from Adam; while "gradient threshold" is element-wise operation, and for each element outputs a value in a fixed range, and each dimension of the parameter is independently thresholded, this might cause 0 denominator.

from adabelief-optimizer.

Related Issues (20)

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.