ray.tune.logger.LoggerCallback#

class ray.tune.logger.LoggerCallback[source]#

Bases: Callback

Base class for experiment-level logger callbacks

This base class defines a general interface for logging events, like trial starts, restores, ends, checkpoint saves, and receiving trial results.

Callbacks implementing this interface should make sure that logging utilities are cleaned up properly on trial termination, i.e. when log_trial_end is received. This includes e.g. closing files.

Methods

__init__

get_state

Get the state of the callback.

log_trial_end

Handle logging when a trial ends.

log_trial_restore

Handle logging when a trial restores.

log_trial_result

Handle logging when a trial reports a result.

log_trial_save

Handle logging when a trial saves a checkpoint.

log_trial_start

Handle logging when a trial starts.

on_checkpoint

Called after a trial saved a checkpoint with Tune.

on_experiment_end

Called after experiment is over and all trials have concluded.

on_step_begin

Called at the start of each tuning loop step.

on_step_end

Called at the end of each tuning loop step.

on_trial_recover

Called after a trial instance failed (errored) but the trial is scheduled for retry.

set_state

Set the state of the callback.

setup

Called once at the very beginning of training.