Esempio n. 1
0
def test_create_deterministic_policy(observation_shape, action_size,
                                     batch_size, use_batch_norm):
    policy = create_deterministic_policy(observation_shape, action_size,
                                         use_batch_norm)

    assert isinstance(policy, DeterministicPolicy)

    x = torch.rand((batch_size, ) + observation_shape)
    y = policy(x)
    assert y.shape == (batch_size, action_size)
Esempio n. 2
0
 def _build_actor(self):
     self.policy = create_deterministic_policy(
         self.observation_shape,
         self.action_size,
         self.use_batch_norm,
         encoder_params=self.encoder_params)
Esempio n. 3
0
 def _build_actor(self):
     self.policy = create_deterministic_policy(self.observation_shape,
                                               self.action_size,
                                               self.actor_encoder_factory)