Event System, Logging & Statistics

This page contains the reference documentation for the event and logging system.

Event System

These are interfaces, classes and utility functions of the event system:

Subscriber

Event aggregation object.

Pubsub

Implementation of a message broker (Pubsub stands for publish and subscribe).

event_topic_factory

Constructs a proxy instance of the event interface, as required by EventService and LogStatsAggregator.

EventScope

Base class for all services that integrate with the event system and therefore use EventService as their backend.

EventService

Manages the recording of event invocations and provides simple event routing functionality.

EventCollection

A collection of EventRecord instances that can be queried by event specification.

EventRecord

This auxiliary class is used to record calls to the event interface

Event Logging

These are the components of the event system:

StepEventLog

Logs all events dispatched by the environment during one step.

EpisodeEventLog

Keeps logs of all events dispatched by an environment during one episode.

KpiCalculator

Interface for calculating KPI metrics.

LogEventsWriterRegistry

Handles registration of event log writers.

LogEventsWriter

Interface for modules writing out the event log data.

LogEventsWriterTSV

Writes event logs into TSV files.

EventRow

Represents one row into the output file for the LogEventsWriterTSV.

SimpleEventLoggingSetup

Simple setup for logging of environment events with all their attributes.

ObservationEvents

Event topic class with logging statistics based only on observations, therefore applicable to any valid reinforcement learning environment.

ActionEvents

Event topic class with logging statistics based only on Gym space actions, therefore applicable to any valid reinforcement learning environment.

RewardEvents

Event topic class with logging statistics based only on rewards, therefore applicable to any valid reinforcement learning environment.

create_categorical_plot

Checks the type of value and calls the correct plotting function accordingly.

create_histogram

Creates simple matplotlib histogram of value.

create_relative_bar_plot

Counts the categories in value and prepares a relative bar plot of these.

create_violin_distribution

Creates simple matplotlib violin plot of value.

Statistics Logging

These are the components of the statistics logging system:

LogStatsEnv

Interface to access logging statistics generated by the environment.

LogStatsWriterConsole

Log statistics writer implementation for the console, mainly for debugging purposes.

LogStatsWriterTensorboard

Log statistics writer implementation for Tensorboard.

LogStatsLevel

Log statistics aggregation levels.

LogStatsConsumer

An interface to receive log statistics.

LogStatsAggregator

Complements the event system by providing aggregation functionality.

LogStatsWriter

A minimal interface concrete log statistics writers must implement.

GlobalLogState

Internal class that encapsulates the global state of the logging system.

LogStatsLogger

Auxiliary class returned by get_stats_logger.

register_log_stats_writer

Set the concrete writer implementation that will receive all successive statistics logging.

log_stats

Helper function.

increment_log_step

Notifies the logging system that the current step is finished.

get_stats_logger

Creates an object that can be used to pipe LogStatAggregator instances with the logging writers.

define_step_stats

Event method decorator, defines a new step statistics calculation for this event.

define_episode_stats

Event method decorator, defines a new episode statistics calculation for this event.

define_epoch_stats

Event method decorator, defines a new epoch statistics calculation for this event.

define_stats_grouping

Event method decorator, defines a grouping of all calculated statistics by an attribute.

define_plot

Event method decorator, defines a plot.

histogram

the histogram reducer function

LogStatsValue

Basic data structure for log statistics

LogStatsGroup

Basic data structure for log statistics

LogStatsKey

Basic data structure for log statistics

LogStats

Basic data structure for log statistics