d3rlpy.encoders.VectorEncoderFactory

class d3rlpy.encoders.VectorEncoderFactory(hidden_units=None, activation='relu', use_batch_norm=False, use_dense=False)[source]

Vector encoder factory class.

This is the default encoder factory for vector observation.

Parameters:
  • hidden_units (list) – list of hidden unit sizes. If None, the standard architecture with [256, 256] is used.
  • activation (str) – activation function name.
  • use_batch_norm (bool) – flag to insert batch normalization layers.
  • use_dense (bool) – flag to use DenseNet architecture.
hidden_units

list of hidden unit sizes.

Type:list
activation

activation function name.

Type:str
use_batch_norm

flag to insert batch normalization layers.

Type:bool
use_dense

flag to use DenseNet architecture.

Type:bool

Methods

create(observation_shape, action_size=None, discrete_action=False)[source]

Returns PyTorch’s enocder module.

Parameters:
  • observation_shape (tuple) – observation shape.
  • action_size (int) – action size. If None, the encoder does not take action as input.
  • discrete_action (bool) – flag if action-space is discrete.
Returns:

an enocder object.

Return type:

torch.nn.Module

get_params(deep=False)[source]

Returns encoder parameters.

Parameters:deep (bool) – flag to deeply copy the parameters.
Returns:encoder parameters.
Return type:dict
get_type()

Returns encoder type.

Returns:encoder type.
Return type:str

Attributes

TYPE = 'vector'