Skip to content

Avoid edge case where Trainer wraps ReduceLROnPlateau in SequentialLR#41

Open
amanchoudhri wants to merge 3 commits into
mainfrom
no-sequential-with-reduce-plateau
Open

Avoid edge case where Trainer wraps ReduceLROnPlateau in SequentialLR#41
amanchoudhri wants to merge 3 commits into
mainfrom
no-sequential-with-reduce-plateau

Conversation

@amanchoudhri
Copy link
Copy Markdown
Collaborator

@amanchoudhri amanchoudhri commented Jul 21, 2023

Closes #40. Because I messed up when creating the branch, should only be merged after merging #39.

"min_lr": scheduler_config.get("MIN_LEARNING_RATE", 0),
}
if len(scheduler_configs) != 1:
raise ValueError(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition should probably be moved outside the for loop. I think it will fail to trigger the error here if the reduce on plateau scheduler is listed as the first of many schedulers

Copy link
Copy Markdown
Collaborator Author

@amanchoudhri amanchoudhri Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it might work actually? With lr scheduler config

"SCHEDULERS": [
    {
        "SCHEDULER_TYPE": "REDUCE_ON_PLATEAU",
        "MULTIPLICATIVE_DECAY_FACTOR": 0.5,
        "PATIENCE": 2
    },
    {
        "SCHEDULER_TYPE": "COSINE_ANNEALING",
        "MIN_LEARNING_RATE": 0.0,
    },
]

I get the desired error:
image

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

Successfully merging this pull request may close these issues.

ReduceLROnPlateau scheduler cannot be wrapped in SequentialLR

2 participants