← all notes

Temporal Difference Learning

concept

Say we have a value network that should predict the future discounted reward for a given state at time t,
𝑠
𝑑
which is
𝑉
(
𝑠
𝑑
)

Then for the next timestep, we can construct a target,
𝑦
𝑑
after the transition and getting a reward
π‘Ÿ
𝑑
.

𝑦
𝑑
=
π‘Ÿ
𝑑
+
𝛾
𝑉
(
𝑠
𝑑
+
1
)

Train the network to reduce the error,

Error
=
𝑦
𝑑
βˆ’
𝑉
(
𝑠
𝑑
)

In a nutshell, what you’re really doing is training a network to estimate reward while it’s performing the action rather than at the end of an episode.

This gets a bit tricky because you are using the network’s own estimate to train the network, but over the course of multiple episodes, the network starts to correct itself towards the actual reward obtained by the agent.

Another way to think about it is that, the network is self-correcting with every transition. Every step, it gets a reward.