A3C

class A3C(model, hyperparas=None, vf_loss_coeff=None)[source]

Bases: parl.core.fluid.algorithm.Algorithm

__init__(model, hyperparas=None, vf_loss_coeff=None)[source]

A3C/A2C algorithm

Parameters:
  • model (parl.Model) – forward network of policy and value
  • hyperparas (dict) – (deprecated) dict of hyper parameters.
  • vf_loss_coeff (float) – coefficient of the value function loss
learn(obs, actions, advantages, target_values, learning_rate, entropy_coeff)[source]
Parameters:
  • obs – An float32 tensor of shape ([B] + observation_space). E.g. [B, C, H, W] in atari.
  • actions – An int64 tensor of shape [B].
  • advantages – A float32 tensor of shape [B].
  • target_values – A float32 tensor of shape [B].
  • learning_rate – float scalar of learning rate.
  • entropy_coeff – float scalar of entropy coefficient.
predict(obs)[source]
Parameters:obs – An float32 tensor of shape ([B] + observation_space). E.g. [B, C, H, W] in atari.
sample(obs)[source]
Parameters:obs – An float32 tensor of shape ([B] + observation_space). E.g. [B, C, H, W] in atari.
value(obs)[source]
Parameters:obs – An float32 tensor of shape ([B] + observation_space). E.g. [B, C, H, W] in atari.