A2C¶
- class A2C(model, vf_loss_coeff=None)[源代码]¶
基类:
parl.core.paddle.algorithm.Algorithm
- __init__(model, vf_loss_coeff=None)[源代码]¶
A2C algorithm
- 参数
model (parl.Model) – forward network of policy and value
vf_loss_coeff (float) – coefficient of the value function loss
- learn(obs, actions, advantages, target_values, learning_rate, entropy_coeff)[源代码]¶
- 参数
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 leanring rate.
entropy_coeff – float scalar of entropy coefficient.
- predict(obs)[源代码]¶
- 参数
obs – An float32 tensor of shape ([B] + observation_space). E.g. [B, C, H, W] in atari.