garage.sampler.sampler_deprecated module

Base class of Sampler.

class BaseSampler(algo, env)[source]

Bases: garage.sampler.sampler_deprecated.Sampler

Base class for sampler.

Parameters:
class Sampler[source]

Bases: abc.ABC

Sampler interface.

obtain_samples(itr, batch_size, whole_paths)[source]

Collect samples for the given iteration number.

Parameters:
  • itr (int) – Number of iteration.
  • batch_size (int) – Number of environment steps in one batch.
  • whole_paths (bool) – Whether to use whole path or truncated.
Returns:

A list of paths.

Return type:

list[dict]

shutdown_worker()[source]

Terminate workers if necessary.

start_worker()[source]

Initialize the sampler.

e.g. launching parallel workers if necessary.