mlrl.testbed.experiments.output.sinks.sink module

Author Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for implementing sinks, output data may be written to.

class mlrl.testbed.experiments.output.sinks.sink.DatasetFileSink(directory: Path, suffix: str, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)

Bases: FileSink, ABC

An abstract base class for all sinks that write datasets to a file.

class mlrl.testbed.experiments.output.sinks.sink.FileSink(directory: Path, suffix: str, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)

Bases: Sink, ABC

An abstract base class for all sinks that write output data to a file.

write_to_sink(state: ExperimentState, output_data: OutputData, **kwargs)

See mlrl.testbed.experiments.output.sinks.sink.Sink.write_to_sink()

class mlrl.testbed.experiments.output.sinks.sink.Sink(options: Options = <mlrl.util.options.Options object>)

Bases: ABC

An abstract base class for all sinks, output data may be written to.

abstractmethod create_source(input_directory: Path) Source | None

Must be implemented by subclasses in order to create a Source that can read the data written to this sink.

Returns:

The Source that has been created or None, if no source is available

abstractmethod write_to_sink(state: ExperimentState, output_data: OutputData, **kwargs)

Must be implemented by subclasses in order to write output data to the sink.

Parameters:
  • state – The state from which the output data has been generated

  • output_data – The output data that should be written to the sink

class mlrl.testbed.experiments.output.sinks.sink.TabularFileSink(directory: Path, suffix: str, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)

Bases: FileSink, ABC

An abstract base class for all sinks that write tabular output data to a file.