Skip to content

Add '--lr_scheduler_type' and '--lr_scheduler_args' argument#271

Merged
kohya-ss merged 6 commits intokohya-ss:devfrom
Isotr0py:dev
Mar 19, 2023
Merged

Add '--lr_scheduler_type' and '--lr_scheduler_args' argument#271
kohya-ss merged 6 commits intokohya-ss:devfrom
Isotr0py:dev

Conversation

@Isotr0py
Copy link
Copy Markdown
Contributor

@Isotr0py Isotr0py commented Mar 9, 2023

  • Add argument --lr_scheduler_type and --lr_scheduler_args to use lr_scheduler from another library

For example, to use torch.optim.lr_scheduler.CosineAnnealingLR with T_max=100 as lr_scheduler, we can just add
--lr_scheduler_type "CosineAnnealingLR" --lr_scheduler_args "T_max=100" or
--lr_scheduler_type "torch.optim.lr_scheduler.CosineAnnealingLR" --lr_scheduler_args "T_max=100"

And the learning rate curve would be:
HK$ZXNQT`CIT F%9_F9$T43

@Isotr0py Isotr0py marked this pull request as ready for review March 10, 2023 11:04
@Isotr0py Isotr0py changed the title Add lr_scheduler_type and lr_scheduler_args Add '--lr_scheduler_type' and '--lr_scheduler_args' Mar 10, 2023
@Isotr0py Isotr0py changed the title Add '--lr_scheduler_type' and '--lr_scheduler_args' Add '--lr_scheduler_type' and '--lr_scheduler_args' argument Mar 10, 2023
@kohya-ss
Copy link
Copy Markdown
Owner

Thank you for this! It looks good. I will review when I have time.

@kohya-ss kohya-ss merged commit 8f08feb into kohya-ss:dev Mar 19, 2023
@kohya-ss
Copy link
Copy Markdown
Owner

I've merged. Thank you!

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.

2 participants