all.logging

class all.logging.DummyLogger

Bases: Logger

A default Logger object that performs no logging and has no side effects.

add_eval(name, value, step='frame')

Log the given evaluation metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_hparams(hparam_dict, metric_dict, step='frame')

Logs metrics for a given set of hyperparameters. Usually this should be called once at the end of a run in order to log the final results for hyperparameters, though it can be called multiple times throughout training. However, it should be called infrequently.

Parameters:
  • hparam_dict (dict) – A dictionary of hyperparameters. Only parameters of type (int, float, str, bool, torch.Tensor) will be logged.

  • metric_dict (dict) – A dictionary of metrics to record.

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_info(name, value, step='frame')

Log the given informational metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_loss(name, value, step='frame')

Log the given loss metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The value of the loss at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_schedule(name, value, step='frame')

Log the current value of a hyperparameter according to some schedule.

Parameters:
  • name (str) – The tag to associate with the hyperparameter schedule

  • value (number) – The value of the hyperparameter at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_summary(name, values, step='frame')

Log a summary statistic.

Parameters:
  • name (str) – The tag to associate with the summary statistic

  • mean (float) – The mean of the statistic at the current step

  • std (float) – The standard deviation of the statistic at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

close()

Close the logger and perform any necessary cleanup.

class all.logging.ExperimentLogger(*args: Any, **kwargs: Any)

Bases: SummaryWriter, Logger

The default Logger object used by all.experiments.Experiment. Writes logs using tensorboard into the current logdir directory (‘runs’ by default), tagging the run with a combination of the agent name, the commit hash of the current git repo of the working directory (if any), and the current time. Also writes summary statistics into CSV files. :param experiment: The Experiment associated with the Logger object. :type experiment: all.experiments.Experiment :param agent_name: The name of the Agent the Experiment is being performed on :type agent_name: str :param env_name: The name of the environment the Experiment is being performed in :type env_name: str :param verbose: Whether or not to log all data or only summary metrics. :type verbose: bool, optional

add_eval(name, value, step='frame')

Log the given evaluation metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_hparams(hparam_dict, metric_dict, step='frame')

Logs metrics for a given set of hyperparameters. Usually this should be called once at the end of a run in order to log the final results for hyperparameters, though it can be called multiple times throughout training. However, it should be called infrequently.

Parameters:
  • hparam_dict (dict) – A dictionary of hyperparameters. Only parameters of type (int, float, str, bool, torch.Tensor) will be logged.

  • metric_dict (dict) – A dictionary of metrics to record.

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_info(name, value, step='frame')

Log the given informational metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_loss(name, value, step='frame')

Log the given loss metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The value of the loss at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_schedule(name, value, step='frame')

Log the current value of a hyperparameter according to some schedule.

Parameters:
  • name (str) – The tag to associate with the hyperparameter schedule

  • value (number) – The value of the hyperparameter at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

add_summary(name, values, step='frame')

Log a summary statistic.

Parameters:
  • name (str) – The tag to associate with the summary statistic

  • mean (float) – The mean of the statistic at the current step

  • std (float) – The standard deviation of the statistic at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

close()

Close the logger and perform any necessary cleanup.

class all.logging.Logger

Bases: ABC

abstract add_eval(name, value, step='frame')

Log the given evaluation metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract add_hparams(hparam_dict, metric_dict, step='frame')

Logs metrics for a given set of hyperparameters. Usually this should be called once at the end of a run in order to log the final results for hyperparameters, though it can be called multiple times throughout training. However, it should be called infrequently.

Parameters:
  • hparam_dict (dict) – A dictionary of hyperparameters. Only parameters of type (int, float, str, bool, torch.Tensor) will be logged.

  • metric_dict (dict) – A dictionary of metrics to record.

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract add_info(name, value, step='frame')

Log the given informational metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The evaluation metric at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract add_loss(name, value, step='frame')

Log the given loss metric at the current step.

Parameters:
  • name (str) – The tag to associate with the loss

  • value (number) – The value of the loss at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract add_schedule(name, value, step='frame')

Log the current value of a hyperparameter according to some schedule.

Parameters:
  • name (str) – The tag to associate with the hyperparameter schedule

  • value (number) – The value of the hyperparameter at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract add_summary(name, mean, std, step='frame')

Log a summary statistic.

Parameters:
  • name (str) – The tag to associate with the summary statistic

  • mean (float) – The mean of the statistic at the current step

  • std (float) – The standard deviation of the statistic at the current step

  • step (str, optional) – Which step to use (e.g., “frame” or “episode”)

abstract close()

Close the logger and perform any necessary cleanup.

log_dir = 'runs'