def _build_critic(self, ):
     """Builds the critic models.
     """
     critic_settings = {
         'input_size': self.state_dim,
         'output_size': self.action_dim,
         'output_activation': 'linear',
     }
     self.critic = models.build_dnn_models(**critic_settings)
     self.critic_target = models.build_dnn_models(**critic_settings)
     self.critic_optim = tf.keras.optimizers.Adam(lr=self.lr_critic)
Exemple #2
0
    def _build_actor(self, ):
        """Builds the actor models.
        """
        actor_settings = {
            'input_size': self.state_dim,
            'output_size': self.action_dim,
            'output_activation': 'tanh',
            'output_scale': self.output_scale,
        }
        self.actor = models.build_dnn_models(**actor_settings)
        self.actor_target = models.build_dnn_models(**actor_settings)
        self.actor_target.set_weights(self.actor.get_weights())

        self.actor_optim = tf.keras.optimizers.Adam(lr=self.lr_actor)
Exemple #3
0
 def _build_actor(self, ):
     """Builds the actor models.
     """
     actor_settings = {
         'input_size': self.state_dim,
         'output_size': self.action_dim,
         'output_activation': 'softmax',
     }
     self.actor = models.build_dnn_models(**actor_settings)
     self.actor_optim = tf.keras.optimizers.Adam(lr=self.lr_actor)