- class torchrl.objectives.value.functional.td0_return_estimate(gamma: float, next_state_value: Tensor, reward: Tensor, done: Tensor)¶
TD(0) discounted return estimate of a trajectory.
Also known as bootstrapped Temporal Difference or one-step return.
gamma (scalar) – exponential mean discount.
next_state_value (Tensor) – value function result with new_state input. must be a [Batch x TimeSteps x 1] or [Batch x TimeSteps] tensor
reward (Tensor) – reward of taking actions in the environment. must be a [Batch x TimeSteps x 1] or [Batch x TimeSteps] tensor
done (Tensor) – boolean flag for end of episode.
All tensors (values, reward and done) must have shape
[*Batch x TimeSteps x *F], with