td0_advantage_estimate¶
- class torchrl.objectives.value.functional.td0_advantage_estimate(gamma: float, state_value: torch.Tensor, next_state_value: torch.Tensor, reward: torch.Tensor, done: torch.Tensor, terminated: torch.Tensor | None = None)[原始碼]¶
軌跡的 TD(0) 優勢估計。
也稱為 bootstrapped Temporal Difference 或一步回報。
- 引數:
gamma (scalar) – 指數平均折扣因子。
state_value (Tensor) – 使用 old_state 輸入得到的值函式結果。
next_state_value (Tensor) – 使用 new_state 輸入得到的值函式結果。
reward (Tensor) – 在環境中執行動作獲得的獎勵。
done (Tensor) – 軌跡結束的布林標誌。
terminated (Tensor) – 回合結束的布林標誌。如果未提供,預設為
done。
所有張量(值、獎勵和 done)必須具有
[*Batch x TimeSteps x *F]的形狀,其中*F是特徵維度。