Skip to content

Fixes the completion_criteria_config dict in the to_input_req method #3744

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sagemaker/tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def to_input_req(self):
"""
completion_criteria_config = {}
if self.max_number_of_training_jobs_not_improving is not None:
completion_criteria_config[BEST_OBJECTIVE_NOT_IMPROVING] = {}
completion_criteria_config[BEST_OBJECTIVE_NOT_IMPROVING][
MAX_NUMBER_OF_TRAINING_JOBS_NOT_IMPROVING
] = self.max_number_of_training_jobs_not_improving
Expand All @@ -569,6 +570,7 @@ def to_input_req(self):
] = self.target_objective_metric_value

if self.complete_on_convergence is not None:
completion_criteria_config[CONVERGENCE_DETECTED] = {}
completion_criteria_config[CONVERGENCE_DETECTED][COMPLETE_ON_CONVERGENCE_DETECTED] = (
"Enabled" if self.complete_on_convergence else "Disabled"
)
Expand Down