garage.np.embeddings.encoder

Base class for context encoder.

class Encoder

Bases: abc.ABC

Inheritance diagram of garage.np.embeddings.encoder.Encoder

Base class of context encoders for training meta-RL algorithms.

spec

Input and output space.

Type:garage.InOutSpec
input_dim

Dimension of the encoder input.

Type:int
output_dim

Dimension of the encoder output (embedding).

Type:int
reset(self, do_resets=None)

Reset the encoder.

This is effective only to recurrent encoder. do_resets is effective only to vectoried encoder.

For a vectorized encoder, do_resets is an array of boolean indicating which internal states to be reset. The length of do_resets should be equal to the length of inputs.

Parameters:do_resets (numpy.ndarray) – Bool array indicating which states to be reset.
class StochasticEncoder

Bases: garage.np.embeddings.encoder.Encoder

Inheritance diagram of garage.np.embeddings.encoder.StochasticEncoder

An stochastic context encoders.

An stochastic encoder maps an input to a distribution, but not a deterministic vector.

distribution

Embedding distribution.

Type:object
spec

Input and output space.

Type:garage.InOutSpec
input_dim

Dimension of the encoder input.

Type:int
output_dim

Dimension of the encoder output (embedding).

Type:int
reset(self, do_resets=None)

Reset the encoder.

This is effective only to recurrent encoder. do_resets is effective only to vectoried encoder.

For a vectorized encoder, do_resets is an array of boolean indicating which internal states to be reset. The length of do_resets should be equal to the length of inputs.

Parameters:do_resets (numpy.ndarray) – Bool array indicating which states to be reset.