td0_return_estimate¶
- class torchrl.objectives.value.functional.td0_return_estimate(gamma: float, next_state_value: torch.Tensor, reward: torch.Tensor, terminated: torch.Tensor | None = None, *, done: torch.Tensor | None = None)[source]¶
軌跡的 TD(0) 折扣回報估計。
也稱為自舉時間差分或一步回報。
- 引數:
gamma (scalar) – 指數平均折扣。
next_state_value (Tensor) – 使用 new_state 輸入的值函式結果。必須是 [Batch x TimeSteps x 1] 或 [Batch x TimeSteps] 張量
reward (Tensor) – 在環境中採取行動的獎勵。必須是 [Batch x TimeSteps x 1] 或 [Batch x TimeSteps] 張量
terminated (Tensor) – 劇集結束的布林標誌。如果未提供,則預設為
done。
- 關鍵字引數:
done (Tensor) – 已廢棄。請改用
terminated。
所有張量(values、reward 和 done)必須具有
[*Batch x TimeSteps x *F]的形狀,其中*F是特徵維度。