Documentation

utils.average_in_episode_three_region(log, column='agent.x', transient=90)[source]

Train performance

Parameters:
  • log (_type_) – _description_

  • column (str, optional) – _description_. Defaults to ‘ChickAgent.x’.

  • transient (int, optional) – _description_. Defaults to 90.

Returns:

_description_

Return type:

_type_

utils.debug_logger(name, loglevel=20)[source]

Create a logger with the specified name and log level.

Parameters:
  • name (str) – The name of the logger.

  • loglevel (int, optional) – The log level for the logger. Defaults to logging.INFO.

Returns:

The created logger.

Return type:

logging.Logger

utils.moving_average(values, window)[source]

Smooth values by doing a moving average :param values: (numpy array) :param window: (int) :return: (numpy array)

utils.omegaconf_to_dict(d: DictConfig) Dict[source]

Converts an omegaconf DictConfig to a python Dict, respecting variable interpolation.

utils.port_in_use(port)[source]

Check if a given port is already in use.

Parameters:

port (int) – The port number to check.

Returns:

True if the port is in use, False otherwise.

Return type:

bool

utils.save_configuration(args, log_dir, filename='configuration.json')[source]

Save the configuration arguments to a JSON file.

Parameters:
  • args – The configuration arguments.

  • log_dir – The directory where the JSON file will be saved.

  • filename – The name of the JSON file (default is ‘configuration.json’).

Returns:

None