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) 軌跡優勢估計。
也稱為自舉時間差或單步回報。
- 引數:
gamma (scalar) – exponential mean discount.
state_value (Tensor) – 使用 old_state 輸入的值函式結果。
next_state_value (Tensor) – 使用 new_state 輸入的值函式結果。
reward (Tensor) – 在環境中採取動作的獎勵。
done (Tensor) – 軌跡結束的布林標誌。
terminated (Tensor) – 劇集結束的布林標誌。如果未提供,則預設為
done。
所有張量(值、獎勵和完成)都必須具有形狀
[*Batch x TimeSteps x *F],其中*F是特徵維度。