feat(handlers): rename EarlyStopping params for consistency with PyTorch#3739
Closed
joemunene-by wants to merge 1 commit intopytorch:masterfrom
Closed
feat(handlers): rename EarlyStopping params for consistency with PyTorch#3739joemunene-by wants to merge 1 commit intopytorch:masterfrom
joemunene-by wants to merge 1 commit intopytorch:masterfrom
Conversation
Rename parameters to align with PyTorch's ReduceLROnPlateau naming: - min_delta -> threshold - min_delta_mode -> threshold_mode - cumulative_delta -> cumulative Old parameter names are preserved as deprecated aliases with DeprecationWarning. Passing both old and new names simultaneously raises ValueError. All existing behavior is maintained for backward compatibility.
Author
|
Thanks for letting me know @ramyars466! I can see your PR #3619 already covers this — glad it's approved and ready to go. Closing this one in favor of yours. |
Contributor
|
Thank you, @joemunene-by! I really appreciate your understanding and support. Looking forward to seeing your future contributions to the project! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the remaining work in #3411 — renames
EarlyStoppingparameters to align with PyTorch'sReduceLROnPlateaunaming conventions, with full backward compatibility and deprecation warnings.Parameter Renames
min_deltathresholdReduceLROnPlateau.thresholdmin_delta_modethreshold_modeReduceLROnPlateau.threshold_modecumulative_deltacumulativeBackward Compatibility
DeprecationWarningand forward the value to the new nameValueErroris raised with a clear messageChanges
ignite/handlers/early_stopping.pyOptionalkwargswarnings.warn()withDeprecationWarningfor each old nameValueErroron conflict (both old + new specified)__call__use new namesversionchanged:: 0.5.5notetests/ignite/handlers/test_early_stopping.pytest_args_validation_deprecated_names— validation through deprecated paramstest_deprecated_min_delta— DeprecationWarning + value forwardingtest_deprecated_cumulative_delta— same for cumulative_deltatest_deprecated_min_delta_mode— same for min_delta_modetest_deprecated_and_new_param_conflict— ValueError when both passedtest_backward_compat_deprecated_params_still_work— end-to-end with old namestest_backward_compat_cumulative_delta— end-to-end with deprecated cumulativetest_backward_compat_min_delta_mode— end-to-end with deprecated threshold_modeTest Plan