syne_tune.remote.remote_metrics_callback module
- class syne_tune.remote.remote_metrics_callback.RemoteTuningMetricsCallback(metric, mode, config_space=None, resource_attr=None)[source]
Bases:
TunerCallback
Reports metrics related to the experiment run by
Tuner
. With remote tuning, if these metrics are registered with the SageMaker estimator running the experiment, they are visualized in the SageMaker console. Metrics reported are:BEST_METRIC_VALUE
: Best value ofmetric
reported to tuner so farBEST_TRIAL_ID
: ID of trial for which the best metric value was reported so farBEST_RESOURCE_VALUE
: Resource value for which the best metric value was reported so far. Only ifresource_attr
is givenIf
config_space
is given, then for each hyperparametername
in there (entry with domain), we add a metricBEST_HP_PREFIX + name
. However, at mostMAX_METRICS_SUPPORTED_BY_SAGEMAKER
are supported
- register_metrics_with_estimator(estimator)[source]
Registers metrics reported here at SageMaker estimator
estimator
. This should be the one which runs the remote experiment.Note: The total number of metric definitions must not exceed
MAX_METRICS_SUPPORTED_BY_SAGEMAKER
. Otherwise, only the initial part ofmetric_names
is registered.- Parameters:
estimator (
EstimatorBase
) – SageMaker estimator to run the experiment
- on_trial_result(trial, status, result, decision)[source]
Called when a new result (reported by a trial) is observed
The arguments here are inputs or outputs of
scheduler.on_trial_result
(called just before).- Parameters:
trial (
Trial
) – Trial whose report has been receivedstatus (
str
) – Status of trial beforescheduler.on_trial_result
has been calledresult (
Dict
[str
,Any
]) – Result dict receiveddecision (
str
) – Decision returned byscheduler.on_trial_result