Пример #1
0
def test_create_categorical_policy(observation_shape, action_size, batch_size,
                                   use_batch_norm):
    policy = create_categorical_policy(observation_shape, action_size,
                                       use_batch_norm)

    assert isinstance(policy, CategoricalPolicy)

    x = torch.rand((batch_size, ) + observation_shape)
    y = policy(x)
    assert y.shape == (batch_size, )
Пример #2
0
 def _build_actor(self):
     self.policy = create_categorical_policy(
         self.observation_shape,
         self.action_size,
         self.use_batch_norm,
         encoder_params=self.encoder_params)
Пример #3
0
 def _build_actor(self):
     self.policy = create_categorical_policy(self.observation_shape,
                                             self.action_size,
                                             self.actor_encoder_factory)