-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #807 from Ainesh06102004/add_optimizers_monai
Add schedulers monai
- Loading branch information
Showing
3 changed files
with
42 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from monai.optimizers import WarmupCosineSchedule as WCS | ||
|
||
def warmupcosineschedule(parameters): | ||
parameters["scheduler"]["warmup_steps"] = parameters["scheduler"].get("warmup_steps",0.1*parameters["num_epochs"]) | ||
|
||
return WCS( | ||
parameters["optimizer_object"], | ||
t_total = parameters["num_epochs"], | ||
warmup_steps = parameters["scheduler"]["warmup_steps"] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters