stable_learning_control.algos.pytorch.common.buffers
Contains several replay buffers used in the Pytorch algorithms.
Classes
Wrapper around the general FIFO |
|
Wrapper around the general FIFO |
|
Wrapper around the general |
Module Contents
- class stable_learning_control.algos.pytorch.common.buffers.ReplayBuffer(device='cpu', *args, **kwargs)[source]
Bases:
stable_learning_control.algos.common.buffers.ReplayBufferWrapper around the general FIFO
ReplayBufferwhich makes sure atorch.tensoris returned when sampling.- device[source]
The device the experiences are placed on (options:
cpu,gpu,gpu:0,gpu:1, etc.).- Type:
Initialise the ReplayBuffer object.
- Parameters:
device (str, optional) – The computational device to put the sampled experiences on (options:
cpu,gpu,gpu:0,gpu:1, etc.). Defaults tocpu.*args – All args to pass to the
ReplayBufferparent class.**kwargs – All kwargs to pass to the class:ReplayBuffer parent class.
- sample_batch(*args, **kwargs)[source]
Retrieve a batch of experiences from buffer.
- Parameters:
*args – All args to pass to the
sample_batch()parent method.**kwargs – All kwargs to pass to the
sample_batch()parent method.
- Returns:
A batch of experiences.
- Return type:
- class stable_learning_control.algos.pytorch.common.buffers.FiniteHorizonReplayBuffer(device='cpu', *args, **kwargs)[source]
Bases:
stable_learning_control.algos.common.buffers.FiniteHorizonReplayBufferWrapper around the general FIFO
FiniteHorizonReplayBufferwhich makes sure atorch.tensoris returned when sampling.- device[source]
The device the experiences are placed on (options:
cpu,gpu,gpu:0,gpu:1, etc.).- Type:
Initialise the FiniteHorizonReplayBuffer object.
- Parameters:
device (str, optional) – The computational device to put the sampled experiences on (options:
cpu,gpu,gpu:0,gpu:1, etc.). Defaults tocpu.*args – All args to pass to the
FiniteHorizonReplayBufferparent class.**kwargs – All kwargs to pass to the class:FiniteHorizonReplayBuffer parent class.
- sample_batch(*args, **kwargs)[source]
Retrieve a batch of experiences from buffer.
- Parameters:
*args – All args to pass to the
sample_batch()parent method.**kwargs – All kwargs to pass to the
sample_batch()parent method.
- Returns:
A batch of experiences.
- Return type:
- class stable_learning_control.algos.pytorch.common.buffers.TrajectoryBuffer(device='cpu', *args, **kwargs)[source]
Bases:
stable_learning_control.algos.common.buffers.TrajectoryBufferWrapper around the general
TrajectoryBufferwhich makes sure atorch.tensoris returned when sampling.- device[source]
The device the experiences are placed on (options:
cpu,gpu,gpu:0,gpu:1, etc.).- Type:
Initialise the TrajectoryBuffer object.
- Parameters:
device (str, optional) – The computational device to put the sampled experiences on (options:
cpu,gpu,gpu:0,gpu:1, etc.). Defaults tocpu.*args – All args to pass to the
TrajectoryBufferparent class.**kwargs – All kwargs to pass to the
TrajectoryBufferparent class.