|
|
|
|
|
|
normalize=self.normalize, |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.linear_encoder = LinearEncoder( |
|
|
|
total_enc_size, network_settings.num_layers, self.h_size |
|
|
|
|
|
|
actions: Optional[torch.Tensor] = None, |
|
|
|
memories: Optional[torch.Tensor] = None, |
|
|
|
sequence_length: int = 1, |
|
|
|
retrun_target = False |
|
|
|
retrun_target=False, |
|
|
|
) -> Tuple[torch.Tensor, torch.Tensor]: |
|
|
|
encodes = [] |
|
|
|
for idx, processor in enumerate(self.processors): |
|
|
|
|
|
|
loss = torch.sum((prediction - target) ** 2, dim=1) |
|
|
|
loss = torch.mean(loss) |
|
|
|
return loss |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ValueNetwork(nn.Module): |
|
|
|