mlrl.testbed.experiments.output.sinks package¶
Author Michael Rapp (michael.rapp.ml@gmail.com)
Provides classes that allow to write output data to different sinks.
- class mlrl.testbed.experiments.output.sinks.CsvFileSink(directory: Path, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)¶
Bases:
TabularFileSinkAllows to write tabular output data to a CSV file.
- COLUMN_MODEL_SIZE = 'Model size'¶
- class mlrl.testbed.experiments.output.sinks.FileSink(directory: Path, suffix: str, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)¶
-
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.LogSink(options: ~mlrl.util.options.Options = <mlrl.util.options.Options object>, source_factory: ~typing.Callable[[~pathlib.Path], ~mlrl.testbed.experiments.input.sources.source.Source] | None = None)¶
Bases:
SinkAllows to write textual output data to the log.
- 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
- 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.PickleFileSink(directory: Path, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)¶
Bases:
FileSinkAllows to write output data to a file by using Python’s pickle mechanism.
- class mlrl.testbed.experiments.output.sinks.Sink(options: Options = <mlrl.util.options.Options object>)¶
Bases:
ABCAn 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.TextFileSink(directory: Path, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)¶
Bases:
FileSinkAllows to write textual output data to a text file.
- class mlrl.testbed.experiments.output.sinks.YamlFileSink(directory: Path, options: Options = <mlrl.util.options.Options object>, create_directory: bool = False)¶
Bases:
FileSinkAllows to write structural output data to a YAML file.
Submodules¶
- mlrl.testbed.experiments.output.sinks.sink module
- mlrl.testbed.experiments.output.sinks.sink_csv module
- mlrl.testbed.experiments.output.sinks.sink_log module
- mlrl.testbed.experiments.output.sinks.sink_pickle module
- mlrl.testbed.experiments.output.sinks.sink_text module
- mlrl.testbed.experiments.output.sinks.sink_yaml module