forked from automl/Auto-PyTorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] Add flexible step-wise LR scheduler with minimum changes (auto…
…ml#256) * [doc] Add the bug fix information for ipython user * [fix] Delete the gcc and gnn install because I could check we can build without them * [feat] Add flexible step-wise LR scheduler with minimum changes Since we would like to merge this feature promptly, I cut this new branch from the branch hot-fix-adapt... and narrowed down the scope of this PR. The subsequent PR addresses the issues, epspecially the format and mypy typing. * [fix] Fix flake8 issue and remove unneeded changes because of mis-branching * [test] Add the tests for the new features * [fix] Fix flake8 issues and torch.tensor to torch.Tensor in typing check The intention behind the change from torch.tensor to torch.Tensor is that since I got an error NoModuleFound `import torch.tensor`. Plus, the torch.tensor is not a TensorType class, but torch.Tensor is. Therefore, I changed the torch.tensor to torch.Tensor. * [feat] Be able to add the step_unit to ConfigSpace * [fix] Fix pytest issues by adding batch-wise update to incumbent Since the previous version always use batch-wise update, I added the step_unit = batch and then avoid the errors I got from pytest. * [fix] Add step_unit info in the greedy portfolio json file Since the latest version only supports the batch-wise update, I just inserted step_unit == "batch" to be able to run greedy portfolio selection. * [refactor] Rebase to the latest development and add overridden functions in base_scheduler * [fix] Fix flake8 and mypy issues * [fix] Fix flake8 issues * [test] Add the test for the train step and the lr scheduler check * [refactor] Change the name to * [fix] Fix flake8 issues * [fix] Disable the step_interval option from the hyperparameter settings * [fix] Change the default step_interval to Epoch-wise * [fix] Fix the step timing for ReduceLROnPlateau and fix flake8 issues * [fix] Add the after-validation option to StepIntervalUnit for ReduceLROnPlateau * [fix] Fix flake8 issues * [fix] Fix loss value for epoch-wise scheduler update * [fix] Delete type check of step_interval and make it property Since the step_interval should not be modified from outside, I made it a property of the base_scheduler class. Furthermore, since we do not have to check the type of step_interval except the initialization, I deleted the type check from prepare method. * [fix] Fix a mypy issue * [fix] Fix a mypy issue * [fix] Fix mypy issues * [fix] Fix mypy issues * [feedback] Address the Ravin's suggestions
- Loading branch information
1 parent
999f3c3
commit 76bdde7
Showing
17 changed files
with
287 additions
and
115 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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
autoPyTorch/pipeline/components/setup/lr_scheduler/constants.py
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,17 @@ | ||
from enum import Enum | ||
|
||
|
||
class StepIntervalUnit(Enum): | ||
""" | ||
By which interval we perform the step for learning rate schedulers. | ||
Attributes: | ||
batch (str): We update every batch evaluation | ||
epoch (str): We update every epoch | ||
valid (str): We update every validation | ||
""" | ||
batch = 'batch' | ||
epoch = 'epoch' | ||
valid = 'valid' | ||
|
||
|
||
StepIntervalUnitChoices = [step_interval.name for step_interval in StepIntervalUnit] |
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
Oops, something went wrong.