trinity.algorithm.sample_strategy package#

Submodules#

Module contents#

class trinity.algorithm.sample_strategy.SampleStrategy(buffer_config: BufferConfig, **kwargs)[source]#

Bases: ABC

__init__(buffer_config: BufferConfig, **kwargs) None[source]#
set_model_version_metric(exp_list: List[Experience], metrics: Dict)[source]#
abstract async sample(step: int) Tuple[Experiences, Dict, List][source]#

Sample data from buffer.

Parameters:

step (int) – The step number of current step.

Returns:

The sampled Experiences data. Dict: Metrics for logging. List: Representative data for logging.

Return type:

Experiences

abstract classmethod default_args() dict[source]#

Get the default arguments of the sample strategy.

abstract state_dict() dict[source]#

Get the state dict of the sample strategy.

abstract load_state_dict(state_dict: dict) None[source]#

Load the state dict of the sample strategy.