Giter Site home page Giter Site logo

Comments (2)

MidoAssran avatar MidoAssran commented on September 16, 2024 1

Hi @andy-yangz,

Thanks for your question.

By multiplying the schedule by 1.25 we only use "80%" of the cosine schedule. You can get a similar effect just by running your pre-training with a regular cosine schedule and applying early stopping. As @woctezuma pointed out, the last value is quite close to _final_m, but I will ensure that this is mentioned in the implementation details.

Please let me know if this answers your question! Otherwise I'd be happy to reopen the issue.

from msn.

woctezuma avatar woctezuma commented on September 16, 2024

msn/src/msn_train.py

Lines 214 to 215 in 81cb855

ipe = len(unsupervised_loader)
logger.info(f'iterations per epoch: {ipe}')

msn/src/msn_train.py

Lines 252 to 259 in 81cb855

# -- momentum schedule
_start_m, _final_m = 0.996, 1.0
_increment = (_final_m - _start_m) / (ipe * num_epochs * 1.25)
momentum_scheduler = (_start_m + (_increment*i) for i in range(int(ipe*num_epochs*1.25)+1))
# -- sharpening schedule
_increment_T = (_final_T - _start_T) / (ipe * num_epochs * 1.25)
sharpen_scheduler = (_start_T + (_increment_T*i) for i in range(int(ipe*num_epochs*1.25)+1))

The first value is _start_m. The last value is _start_m + (_increment*i) where:

  • _increment is (_final_m - _start_m) / delta
  • i is int(delta)

and delta is (ipe * num_epochs * 1.25)

So the last value is pretty close to _final_m, no? It is _start_m + (_final_m - _start_m) * int(delta) / delta.

If ipe * num_epochs is a multiple of 100, then delta is an integer anyway.

from msn.

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.