pytorchrl.agent.actors.memory_networks package

Submodules

pytorchrl.agent.actors.memory_networks.gru_net module

class pytorchrl.agent.actors.memory_networks.gru_net.GruNet(input_size, output_size=256, num_layers=1, activation=<class 'torch.nn.modules.activation.ReLU'>, dropout=0.0)[source]

Bases: torch.nn.modules.module.Module

Implements a GRU model

forward(inputs, rhs, done)[source]

Forward pass Neural Network

Parameters
  • inputs (torch.tensor) – A tensor containing episode observations.

  • rhs (torch.tensor) – A tensor representing the recurrent hidden states.

  • done (torch.tensor) – A tensor indicating where episodes end.

Returns

  • x (torch.tensor) – Output feature map.

  • rhs (torch.tensor) – Updated recurrent hidden state.

get_initial_recurrent_state(num_proc)[source]

Returns a tensor of zeros with the expected shape of the model’s rhs.

property num_outputs

Output feature map size (as in np.prod(self.output_shape)).

property recurrent_hidden_state_size

Recurrent hidden state size

training: bool

Module contents

pytorchrl.agent.actors.memory_networks.get_memory_network(name)[source]

Returns model class from name.