SAC

class SAC(model, gamma=None, tau=None, alpha=None, actor_lr=None, critic_lr=None)[源代码]

基类:Algorithm

__init__(model, gamma=None, tau=None, alpha=None, actor_lr=None, critic_lr=None)[源代码]

SAC algorithm

参数:
  • model (parl.Model) – forward network of actor and critic.

  • gamma (float) – discounted factor for reward computation

  • tau (float) – decay coefficient when updating the weights of self.target_model with self.model

  • alpha (float) – temperature parameter determines the relative importance of the entropy against the reward

  • actor_lr (float) – learning rate of the actor model

  • critic_lr (float) – learning rate of the critic model

learn(obs, action, reward, next_obs, terminal)[源代码]

Define the loss function and create an optimizer to minize the loss.

predict(obs)[源代码]

Refine the predicting process, e.g,. use the policy model to predict actions.

sample(obs)[源代码]

Define the sampling process. This function returns an action with noise to perform exploration.