Answers.Body: <p>Here is my understanding:</p>
  <p>In trajectory sampling as the book describes it, we use the current policy on the simulator to get (next-state, action) pairs. The advantage is that if some states occur more frequently than others in that environment, and if we take enough samples, the distribution among the samples would be similar to the actual distribution.</p>
  <p>On the another hand, you can sample in a different manner if you have access to the model. Suppose you have access to the transition distribution. Then you can sample your start state uniformly, and use the transition distribution to get the (next-state, action) pairs. This can be useful if you want to force your algorithm to look at all states evenly, even if that's not the actual case.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-28T14:27:44.530Z
Answers.LastActivityDate: 2020-06-28T14:27:44.530Z
Answers.UserDisplayName: pecey
Body: <p>I am using Sutton and Barto's book for Reinforcement Learning.</p>
  <p>In Chapter 8, I am having difficulty in understanding the Trajectory Sampling.</p>
  <p>I have read the particular section on trajectory sampling (Sec 8.6) two times (plus 3rd time partially) but still, I do not get how it is different from the normal sampling update, and what are its benefits.</p>
  
Tags: <reinforcement-learning><comparison><importance-sampling><dyna>
Title: How is trajectory sampling different than normal (importance) sampling in reinforcement learning?
UserDisplayName: SJa
ThreadText: # How is trajectory sampling different than normal (importance) sampling in reinforcement learning?
  
  (Asked by: username_0 on 2020-06-28)
  
  I am using Sutton and Barto's book for Reinforcement Learning.
  
  In Chapter 8, I am having difficulty in understanding the Trajectory Sampling.
  
  I have read the particular section on trajectory sampling (Sec 8.6) two times (plus 3rd time partially) but still, I do not get how it is different from the normal sampling update, and what are its benefits.
  
  **Tags:** reinforcement-learning, comparison, importance-sampling, dyna
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-28. Score: 1
  
  Here is my understanding:
  
  In trajectory sampling as the book describes it, we use the current policy on the simulator to get (next-state, action) pairs. The advantage is that if some states occur more frequently than others in that environment, and if we take enough samples, the distribution among the samples would be similar to the actual distribution.
  
  On the another hand, you can sample in a different manner if you have access to the model. Suppose you have access to the transition distribution. Then you can sample your start state uniformly, and use the transition distribution to get the (next-state, action) pairs. This can be useful if you want to force your algorithm to look at all states evenly, even if that's not the actual case.
  
  
  ---
  
  