garage.sampler.batch_sampler module

Class with batch-based sampling.

class BatchSampler(algo, env)[source]

Bases: garage.sampler.sampler_deprecated.BaseSampler

Class with batch-based sampling.

Parameters:
obtain_samples(itr, batch_size=None, whole_paths=True)[source]

Sample the policy for new trajectories.

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]

Shutdown workers.

start_worker()[source]

Start workers.