renate.utils.syne_tune module#

class renate.utils.syne_tune.TuningLoggerCallback(mode, metric)[source]#

Bases: TunerCallback

Syne Tune Logging Callback when running hyperparameter optimization.

Will report whenever improved results are obtained. If no better configuration is received within the last ten minutes, it will send a message to indicate it is still running.

on_trial_result(trial, status, result, decision)[source]#

Called whenever the tuner receives a new (intermediate) observation.

Return type:

None

class renate.utils.syne_tune.TrainingLoggerCallback[source]#

Bases: TunerCallback

Syne Tune Logging Callback when training a single configuration.

Will report all metrics after each epoch.

on_trial_result(trial, status, result, decision)[source]#

Called whenever the tuner receives a new (intermediate) observation.

Return type:

None

renate.utils.syne_tune.redirect_to_tmp(uri)[source]#

Changes uri in /opt/ml to /tmp.

Syne Tune stores checkpoints by default in /opt/ml when running on SageMaker. While we want to store checkpoints, we have no interest in uploading them to S3. Therefore, this function changes the location to /tmp instead.

Return type:

str

renate.utils.syne_tune.config_space_to_dict(config_space)[source]#

Converts config_space into a dictionary that can be saved as a json file.

Return type:

Dict[str, Union[int, float, str]]

renate.utils.syne_tune.config_space_from_dict(config_space_dict)[source]#

Converts the given dictionary into a Syne Tune search space.

Return type:

Dict[str, Union[Domain, int, float, str]]

renate.utils.syne_tune.best_hyperparameters(experiment, config_space)[source]#

Returns the values of all keys in the config_space that belong to a Syne Tune search space.

Return type:

Dict[str, Union[int, float, str]]

renate.utils.syne_tune.is_syne_tune_config_space(config_space)[source]#

Returns True if any value in the configuration space defines a Syne Tune search space.

Return type:

bool