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

Separate lr_configs for generator optimizer and discriminator optimizer #280

Open
eehitray opened this issue Apr 10, 2022 · 4 comments
Open
Assignees
Labels
kind/feature request new feature/model/datasets/config etc. priority/P0 highest priority status/WIP work in progress normally
Milestone

Comments

@eehitray
Copy link

Is there a way to specify a separate lr_config for the generator optimizer, and a separate lr_config for the discriminator optimizer? From my understanding, the lr_config specified in the config file applies to both the generator and the discriminator optimizer.

@plyfager
Copy link
Collaborator

Sure, you can set a separate learning rate in the optimizer.
Example: https://github.com/open-mmlab/mmgeneration/blob/master/configs/_base_/models/biggan/biggan_128x128.py#L30-L32

@eehitray
Copy link
Author

I understand that; however, I wish to set up a separate lr_config; for example, using CosineAnnealing for the generator but no annealing for the discriminator. Is this possible?

@plyfager
Copy link
Collaborator

Got your point, this feature is not supported now. We are currently working on a refactor which covers this feature, probably done by the end of June.

@zengyh1900 zengyh1900 added this to the 0.8.0 milestone Oct 13, 2022
@zengyh1900 zengyh1900 added awaiting response kind/feature request new feature/model/datasets/config etc. priority/P0 highest priority labels Oct 13, 2022
@plyfager
Copy link
Collaborator

plyfager commented Oct 13, 2022

In 1.x, you can set parameter_scheduler like this for your purpose.

param_scheduler = dict(
generator = dict(
    type='LinearLrInterval',  xxx),
discriminator = dict(type=xxx)
)

@plyfager plyfager added status/WIP work in progress normally and removed awaiting response labels Oct 13, 2022
LeoXing1996 pushed a commit to LeoXing1996/mmgeneration that referenced this issue Oct 27, 2022
Co-authored-by: liyinshuo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature request new feature/model/datasets/config etc. priority/P0 highest priority status/WIP work in progress normally
Projects
None yet
Development

No branches or pull requests

3 participants