GithubHelp home page GithubHelp logo

DROCC Learning Rate Sheduler about edgeml HOT 2 CLOSED

mpierrau avatar mpierrau commented on June 1, 2024
DROCC Learning Rate Sheduler

from edgeml.

Comments (2)

mpierrau avatar mpierrau commented on June 1, 2024

I just found the repo of one of the authors (Sachin Goyal), in which the following snippet could be found in cifar/code/train_cifar_pgd.py:

#LR SCHEDULER
def adjust_learning_rate(optimizer, epoch, args):
    """decrease the learning rate"""
    lr = args.lr
    if epoch <= args.epochs:
        lr = args.lr * 0.01
    if epoch <= 0.80*args.epochs:
        lr = args.lr * 0.1 
    if epoch <= 0.40*args.epochs:
        lr = args.lr    
    for param_group in optimizer.param_groups:
        param_group['lr'] = lr

which hints at the used learning rate scheduler for the CIFAR-10 experiment. The can easily be replaced by a torch.lr_scheduler.StepLR scheduler with step_size=0.4*n_epochs and gamma=0.1, where n_epochs is the total number of epochs.

However, the arguments for lr_scheduler in drocc_trainer.py suggests that the learning rate may be different for the "pretraining" (without adversarial loss) phase.

I suppose I can experiment a bit with it, but I definitely think that the lr_scheduler utilized in drocc_trainer.py should be either removed or properly explained, and I would much appreciate some clarification on the parameters used during the experiments.

Cheers!

from edgeml.

SachinG007 avatar SachinG007 commented on June 1, 2024

Hi @mpierrau ,
Thanks for your interest in our work.

1)The LR scheduler used has been specified in the examples file.
For example : for CIFAR : here

2)We havent used the standard torch StepLR just for the simple reason that we didnt want to consider the initial "pretraining" warm up steps (without adversarial phase) as you correctly pointed out. The learning rate for pretraining is not different, but constant and equal to the specified initial LR.
I believe reading the code snippet linked above (linking here again) should clarify all your doubts.

Feel free to reach out for further queries.

Thanks
-Sachin

from edgeml.

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.