d3rlpy.encoders.PixelEncoderFactory

class d3rlpy.encoders.PixelEncoderFactory(filters=None, feature_size=512, activation='relu', use_batch_norm=False)[source]

Pixel encoder factory class.

This is the default encoder factory for image observation.

Parameters:
  • filters (list) – list of tuples consisting with (filter_size, kernel_size, stride). If None, Nature DQN-based architecture is used.
  • feature_size (int) – the last linear layer size.
  • activation (str) – activation function name.
  • use_batch_norm (bool) – flag to insert batch normalization layers.
filters

list of tuples consisting with (filter_size, kernel_size, stride).

Type:list
feature_size

the last linear layer size.

Type:int
activation

activation function name.

Type:str
use_batch_norm

flag to insert batch normalization layers.

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 = 'pixel'