trw.hparams.store

Module Contents

Classes

RunResult

Represent the result of a run

RunStore

Helper class that provides a standard way to create an ABC using

RunStoreFile

Linear file based store.

Attributes

Metrics

trw.hparams.store.Metrics
class trw.hparams.store.RunResult(metrics: Metrics, hyper_parameters: trw.hparams.params.HyperParameters, history: trw.basic_typing.History, info: Any = None)

Represent the result of a run

class trw.hparams.store.RunStore

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract close(self) → None

Close the store

abstract save_run(self, run_result: RunResult) → None

Save the results of a run

Parameters

run_result – the results to record

abstract load_all_runs(self) → Sequence[RunResult]

Load all the runs

__enter__(self)
__exit__(self, exc_type, exc_val, exc_tb)
class trw.hparams.store.RunStoreFile(store_location: str, serializer=pickle)

Bases: RunStore

Linear file based store.

Notes

  • we don’t keep the file open, since we may have several stores reading from this location (single writer but many reader). Reading and writing must happen on the same thread

close(self) → None

Close the store

save_run(self, run_result: RunResult) → None

Save the results of a run

Parameters

run_result – the results to record

load_all_runs(self) → List[RunResult]

Load all the runs