Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use WarmupReduceLROnPlateauScheduler in one epoch train part? #3

Open
pikaliov opened this issue Apr 1, 2023 · 0 comments
Open

Comments

@pikaliov
Copy link

pikaliov commented Apr 1, 2023

In your example, warmup_steps=30000, steps_in_epoch=10000. And condition timestep < warmup_steps is met always.
I guess it's mistake of constants in provided example.

So I wanna use you lr scheduler, but I can't get it how to use it properly.
When I should use scheduler step() in one epoch train part ? Always? Or increment timestep each epoch and when timestep > warmup_steps I will use scheduler.step() ?

scheduler = WarmupReduceLROnPlateauScheduler(
        optimizer, 
        init_lr=1e-10, 
        peak_lr=1e-4, 
        warmup_steps=30000, 
        patience=1,
        factor=0.3,
    )

    for epoch in range(max_epochs):
        for timestep in range(steps_in_epoch):
            ...
            ...
            if timestep < warmup_steps:
                scheduler.step()
                
        val_loss = validate()
        scheduler.step(val_loss)
@pikaliov pikaliov changed the title How to use WarmupReduceLROnPlateauScheduler on one epoch train part? How to use WarmupReduceLROnPlateauScheduler in one epoch train part? Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant