Skip to main content

Questions tagged [temporal-difference-methods]

For questions related to the temporal-difference reinforcement learning (RL) algorithms, which is a class of model-free (that is, they do not use the transition and reward function of the MDP) RL algorithms which learn by bootstrapping from the current estimate of the value function (that is, they use one estimate to update another estimate).

Filter by
Sorted by
Tagged with
1 vote
1 answer
22 views

SARSA Implementation - how to arrive at a convergence constraint, if the optimal value function is not known?

I have an Inverted pendulum domain, where I need to discretize state space (defined by 2 state variables - angle and angular velocity with given ranges) and action space (torque values with given ...
jarvis's user avatar
  • 11
1 vote
1 answer
35 views

RMSprop approach applied to Q-learning for adaptive dynamic learning rate

I am new to this group, Anybody familiar with Q-learning algorithm and RMSprop approach ? i have a question regarding the application of RMSprop approach into Q-Learning to adapt dynamically the ...
Marouane Ben-akka's user avatar
3 votes
1 answer
59 views

Derivation of Sutton & Barto TD(λ) Weight Update Equation with Eligibility Traces

I'm working through Sutton & Barto's Reinforcement Learning: An Introduction, 2nd edition, and trying to understand the derivation of Equation 12.7 for TD(λ) weight updates in Chapter 12, ...
AJR's user avatar
  • 31
0 votes
1 answer
28 views

Proof that Temporal-Difference TD(1) is Equivalent to Widrow-Hoff

I'm reading Sutton's "Learning to Predict by the Methods of Temporal Differences" and I'm getting hung up on a derivation (p. 14). We are considering (observation-sequence, outcome) pairs. $[...
Matheo Xenakis's user avatar
1 vote
1 answer
39 views

Why is importance sampling ratio in n-step TD multiplying error rather than return n-step return?

Why is importance sampling ratio in n-step TD is multiplying error rather than return? In Monte Carlo methods for state values, importance sampling ratio was simply a multiplier for the return.
DSPinfinity's user avatar
  • 1,103
3 votes
0 answers
95 views

Sutton & Barto: Exercise 7.11 mistake?

Exercise from the book: 7.11 Show that if the approximate action values are unchanging, then the tree-backup return (7.16) can be written as a sum of expectation-based TD errors: $$ \begin{align*} &...
Max Gorbunov's user avatar
1 vote
1 answer
41 views

Unclear sentence in Sutton-Barto in Temporal-Difference chapter

Sutton-Barto, Chapter 6, page:130 By 8000 time steps, the greedy policy was long since optimal (a trajectory from it is shown inset); continued $\epsilon$-greedy exploration kept the average episode ...
DSPinfinity's user avatar
  • 1,103
0 votes
0 answers
42 views

Derivation of update rule for Off-policy TD(0) with importance sampling ratio

Sutton-Barto, second edt, page 128, Exercise 6.7: Design an off-policy version of the TD(0) update that can be used with arbitrary target policy $\pi$ and covering behavior policy $b$, using at each ...
DSPinfinity's user avatar
  • 1,103
0 votes
0 answers
30 views

Pseudocode for batch TD(0)

This is from Sutton-Barto, second edt, page 126: Suppose there is available only a finite amount of experience, say 10 episodes or 100 time steps. In this case, a common approach with incremental ...
DSPinfinity's user avatar
  • 1,103
1 vote
0 answers
115 views

Calculating TD($\lambda$) returns, reinforcement learning

I am having some trouble with answering the following question: A rat is involved in an experiment. It experiences one episode. At the first step it hears a bell. At the second step it sees a light. ...
Nat's user avatar
  • 13
2 votes
1 answer
260 views

Where does the TD formula for tic-tac-toe in Sutton & Barto come from?

In section $1.5$ of the book "Reinforcement Learning: An Introduction" by Sutton and Barto they use tic-tac-toe as an example of an RL use case. They provide the following temporal ...
mNugget's user avatar
  • 167
3 votes
2 answers
379 views

Is the Bellman backup unbiased?

This is comes from cs285 2023Fall hw3. In my opinion, if $\hat{Q}$ is unbiased estimate of $Q$, then $$ \begin{align} \mathbb{E}_{D \sim P}[B_{D}\hat{Q} - B_{D}Q] &= \mathbb{E}_{D \sim P}[r(s,a) +...
yeebo xie's user avatar
0 votes
0 answers
30 views

Derivation of TD(0) with Gradient Correction (TDC)

I'm trying to understand the derivation of TDC from Sutton and Barto, but I'm stuck on the steps between lines 2 and 3. It seems that the importance sampling ratio just "disappears" between ...
Shitij Govil's user avatar
3 votes
1 answer
308 views

Convergence of epsilon greedy policy (with no epsilon decay) using TD Learning?

If I create a policy using the q-values of an epsilon greedy policy using the Sarsa algorithm (not changing the epsilon with each episode), will it converge to the optimal solution to the MDP? I am ...
Prabhjot Singh Rai's user avatar
0 votes
1 answer
101 views

Why does my implementation of TD(0) not work?

I am trying to implement TD(0) among other RL Policy Evaluation techniques. I have also implemented the dynamic programming approach for a given model of the world and FV Monte Carlo and EV Monte ...
mavex857's user avatar
0 votes
0 answers
70 views

Finding a value at which TD(lambda) and Monte Carlo Are Similar

Let's say that I'm trying to find a value of lambda for which running a TD(lambda) method will produce the same results as a Monte Carlo method (within a small margin or error, of course). One of the ...
faangorn's user avatar
0 votes
1 answer
160 views

How to calculate TD error?

I just start to learn reinforcement learning and confuse with TD error. We calculate temporal difference with V(t) = V(t) + α[Rt+1 + γV(t+1) - V(t)] where inside bracket is called TD error. The ...
ryan chandra's user avatar
1 vote
1 answer
95 views

TD Leaf value function update

I'm currently watching a RL course by David Silver and he explains the update of TD Leaf, here is the slide: He says that if, at the next turn (after we played red and the opponent played blue) ...
FluidMechanics Potential Flows's user avatar
0 votes
1 answer
94 views

Consequence of Dvoretzky Stochastic Approximation Theorem

I am trying to understand all the steps to prove the TD0 algorithm, and I am following a proof which uses a theorem of Tommi Jaakkola, Michael I. Jordan and Satinder P. Singh, in the paper: On the ...
Kareit's user avatar
  • 19
0 votes
1 answer
43 views

Time index in TD(0) return

in TD(0). for the return we have: $G_{t:t+1}=r_{t+1}+\gamma v_t(s_{t+1})$. Why is the time index on right hand side in $v$ is $t$?
DSPinfinity's user avatar
  • 1,103
1 vote
1 answer
47 views

Confusion in subscript for n-step TD(0)

This is n-step TD(0) update rule: $v_{k+n}(x_k)=v_{k+n-1}(x_k)+\alpha [g_{k:k+n}-v_{k+n-1}(x_k)]$ Why is the subscript on the left hand-side of equation "k+n", not "k+n-1"? Does ...
DSPinfinity's user avatar
  • 1,103
1 vote
1 answer
232 views

Where is the problem: in batch TD(0) algorithm or in the code to solve AB problem in Sutton-Barto RL book?

Here is the batch TD(0) algorithm: Here is the AB example I want to solve using batch TD(0): And finally here is my Matlab code: % eps1: A 0 B 0 % eps2: B 1 % eps3: B 1 % eps4: B 1 % eps5: B 1 % ...
DSPinfinity's user avatar
  • 1,103
1 vote
1 answer
443 views

Proof of convergence of TD(0) algorithm

I am looking for a proof of the following tabular TD(0) algorithm: However, I can only find proofs with the more general TD($\lambda$) algorithm and I am having problems understanding them. In ...
Kareit's user avatar
  • 19
0 votes
1 answer
104 views

How can I get Q-Learning (1 step off policy) update from n-step off policy learning update?

In Sutton and Barto we have expressions for Q-Learning and n-step Off policy learning. The former ought to be the 1-step limit of the latter but I cannot see it working out that way. What am I missing?...
Borun Chowdhury's user avatar
1 vote
1 answer
325 views

Using TD algorithms, if the value function of terminal states is always 0, why would a policy ever choose it?

Temporal difference algorithms (TD($\lambda$)) are tabular solutions to reinforcement learning problems. That is, they create a table of all the states in the problem, and estimate the expected long-...
Multihunter's user avatar
1 vote
2 answers
76 views

Given a set of trajectories produced by a fixed policy, what is the the standard approach to estimate Q?

Let's say that I have a set of trajectories $\mathcal{D} = \{\tau_1, \dots, \tau_n\}$ produced by an agent acting in a (episodic) MDP with a fixed policy $\pi$. I would like to estimate the $Q$ ...
Onil90's user avatar
  • 183
1 vote
1 answer
129 views

If Least-Squares TD is computationally more expensive, then why is it more data efficient than semi-gradient TD(0)?

In Sutton-Barto (Section: 9.8 Least-Squares TD, page 228): Authors say that Least-Squares TD is the most "data efficient" form of linear TD(0). Later, in this section, they say the ...
user3489173's user avatar
0 votes
1 answer
199 views

When using TD(λ), how do you calculate the eligibility trace per input & weight of a neural network neuron?

I have a Neural Network, each Neuron is made up of inputs, weights, and output. I have potentially multiple hidden layers. The activation function executed against the output is not known by the ...
NeomerArcana's user avatar
1 vote
0 answers
119 views

What is 'eligibility' in intuitive terms in TD($\lambda$) learning?

I am watching the lecture from Brown University (in udemy) and I am in the portion of Temporal Difference Learning. In the pseudocode/algorithm of TD(1) (seen in the screenshot below), we initialise ...
cgo's user avatar
  • 185
0 votes
1 answer
256 views

Why $ t=τ+n-1$ instead of $t=τ+n$ in n-step TD?

If $\tau$ is the time, whose state’s estimate is being updated, and $t$ is the current time, then, in n-step TD method, we have $t=\tau+n$ (because we have to wait n-steps, before we can update). ...
DSPinfinity's user avatar
  • 1,103
2 votes
1 answer
92 views

Why do we have $t$ as subscript in $V$ instead of $t+1$ in the expression of $G_{t:t+1}$?

In one-step TD updates, the target is the first reward plus the discounted estimated value of the next state, which we call the one-step return (page 143 of Sutton & Barto): $$ G_{t:t+1} \...
DSPinfinity's user avatar
  • 1,103
5 votes
1 answer
259 views

In TD(0) with linear function approximation, why is the gradient of $\hat v(S^{\prime}, \mathbf w)$ wrt parameters $\mathbf w$ not considered?

I am reading these slides. On page 38, the update for the parameters for the linear function approximation of TD(0) is given. I have a doubt regarding this. The cost function (RMSE) is given on page ...
A Yoghes's user avatar
2 votes
1 answer
604 views

How does this TD(0) off-policy value update formula work?

The update formula for the TD(0) off-policy learning algorithm is (taken from these slides by D. Silver for lecture 5 of his course) $$ \underbrace{V(S_t)}_{\text{New value}} \leftarrow \underbrace{V(...
KoKlA's user avatar
  • 133
1 vote
1 answer
422 views

Is there a tutorial for understanding the proof of convergence for TD learning?

I'm reading the article An Analysis of Temporal-Difference Learning with Function Approximation (1997), but the mathematics inside seems overly complicated for me. Answers to some similar questions ...
heiyezhu6324's user avatar
2 votes
2 answers
891 views

How does $\alpha$ affect the convergence of the TD algorithm?

In Temporal-Difference Learning, we update our value function by $V\left(S_{t}\right) \leftarrow V\left(S_{t}\right)+\alpha\left(R_{t+1}+\gamma V\left(S_{t+1}\right)-V\left(S_{t}\right)\right)$ If we ...
XXX's user avatar
  • 143
2 votes
0 answers
330 views

Why does TD (0) converge to the MLE solution of the Markov model?

Why does TD (0) converge to the MLE solution of the Markov model? Let's take the Example 6.4 in Sutton and Barto's book as an example. Example 6.4: You are the Predictor Place yourself now in the ...
XXX's user avatar
  • 143
2 votes
1 answer
636 views

How to handle invalid actions for next state in Q-learning loss

I am implementing an RL application in an environment with illegal moves. For handling the illegal moves, I am currently just picking an action as the maximum Q-value from the set of legal Q-values. ...
John Rothman's user avatar
0 votes
1 answer
146 views

Why don't we bootstrap terminal state in n-step temporal difference prediction update equation?

In the algorithm below, when $\tau + n \geq T$, shouldn't the algorithm bootstrap with the value of the next state? For instance, when $T=5, \tau=3, \& \; n=2$, we don't bootstrap the sample ...
user529295's user avatar
0 votes
0 answers
29 views

Why does one-step TD strengthen only the last action of the sequence of actions that led to the high reward, while n-step TD the last n actions?

In the caption of figure 7.4 (p. 147) of Sutton & Barto's book (2nd edition), it's written The one-step method strengthens only the last action of the sequence of actions that led to the high ...
user529295's user avatar
0 votes
0 answers
74 views

How does n-step Temporal Difference remove the notion of time-step?

How does n-step TD removes the notion of time-step as referenced in Sutton and Barto (2nd edition, Page 163) below? Another way of looking at the benefits of n-step methods is that they free you from ...
user529295's user avatar
2 votes
1 answer
377 views

How does the learning rate $\alpha$ vary in stationary and non-stationary environments?

In Sutton and Barto's book (Chapter 6: TD learning, 2nd edition), he mentions two ways of updating value function: Monte Carlo method: $V(S_t) \leftarrow V(S_t) + \alpha[G_t - V(S_t)]$. TD(0) method: ...
user529295's user avatar
0 votes
0 answers
154 views

What are the recurrences used for updating state value function in $TD$ and $TD(\lambda)$ learning?

There are two types of value functions in reinforcement learning: State value function $V^{\pi} (s)$, state-action value function $Q^{\pi}(s, a)$. State value function: This value tells us how good ...
hanugm's user avatar
  • 3,990
2 votes
1 answer
119 views

Recursive Least squares (RLS) for mini batch

For my application I am considering a learning problem where I simulate a bunch of episodes say '$n$' first, and than carry out the recursive least squares update. Similar to $TD(1)$. I know that RLS ...
Prakash Gawas's user avatar
0 votes
0 answers
274 views

Comparison between TD(0) and MC ( or GAE )?

I'm getting started with DRL and have trouble distinguishing TD(0), MC, and GAE; and which scenarios one's better than others. Here is what I understand so far: TD(0): increment learning, can learn ...
Ngoc Bui's user avatar
1 vote
1 answer
338 views

What would be the importance sampling ratio for off-policy TD learning control using Q values?

The off-policy TD learning control using state value function from page 34 of David Silver's RL lecture is: $$ V(S_t) \leftarrow V(S_t) + \alpha \left( \frac{ \pi(A_t|S_t)}{\mu (A_t|S_t)} (R_{t+1} + \...
Cauchy's user avatar
  • 113
4 votes
1 answer
215 views

How should I implement the state transition when it is a Gaussian distribution?

I am reading this paper Anxiety, Avoidance and Sequential Evaluation and is confused about the implementation of a specific lab study. Namely, the authors model what is called the Balloon task using a ...
dezdichado's user avatar
0 votes
1 answer
499 views

When calculating the cost in deep Q-learning, do we use both the input and target states?

I just finished Andrew Ngs's deep learning specialization, but RL was not covered, so I don't know the basics of RL. So, I have been having trouble understanding the cost function in deep Q-learning. ...
junfanbl's user avatar
  • 323
3 votes
1 answer
221 views

Is the expected value we sample in TD-learning action-value Q or state-value V?

Both MC and TD are model-free and they both follow a sample trajectory (in the case of TD, the trajectory is cut-short) to estimate the return (we basically are sampling Q values). Other than that, ...
Aung Khant's user avatar
3 votes
1 answer
2k views

How to determine if Q-learning has converged in practice?

I am using Q-learning and SARSA to solve a problem. The agent learns to go from the start to the goal without falling in the holes. At each state, I can choose the action corresponding to the maximum ...
WANGWANGZI's user avatar
4 votes
2 answers
325 views

Why is the target called "target" in Monte Carlo and TD learning if it is not the true target?

I was going through Sutton's book and, using sample-based learning for estimating the expectations, we have this formula $$ \text{new estimate} = \text{old estimate} + \alpha(\text{target} - \text{old ...
Chukwudi Ogbonna's user avatar