4
$\begingroup$

I want to build model-based RL. I am wondering about the process of building the model.

If I already have data, from real experience:

  • $S_1, a \rightarrow R,S_2$
  • $S_2, a \rightarrow R,S_3$

Can I use this information, to build model-based RL? Or it is necessary that the agent directly interact with the environment (I mean the same above-mentioned data should be provided by the agent)?

$\endgroup$
4
  • $\begingroup$ u may use q-network (model), fit the model with known real experience before the RL training process instead of a regular step of randomising the weights $\endgroup$ – datdinhquoc Apr 7 at 9:26
  • 1
    $\begingroup$ @datdinhquoc that is wrong, Q-learning is model free. $\endgroup$ – David Ireland Apr 7 at 9:32
  • $\begingroup$ that q-network has n-action softmax neurons in output layer of qvalues which can be applied to argmax to get max action, isn't it the model $\endgroup$ – datdinhquoc Apr 7 at 9:34
  • 2
    $\begingroup$ no, when people refer to a model they are talking about modelling the environment dynamics such as $p(s'|s, a)$. $\endgroup$ – David Ireland Apr 7 at 9:35
0
$\begingroup$

If you already have some transition tuples then you can train a model to predict environment dynamics using these. However, you should be careful that your pre-gathered data is diverse enough to 'cover' enough of the state/action space so that your model remains accurate. For instance, when you start training your agent it will likely start to see more of the state space than it did at the start of training (imagine playing Atari, initially your agent will die quickly but as it gets better episodes will get longer) so you would need to make sure you have data for these states that appear late in episodes, otherwise your model will just be overfitting to the start of the episode and will give a poor performance on these other states, thus slowing down or even prohibiting learning of an optimal policy.

$\endgroup$
8
  • 1
    $\begingroup$ Thank you, your issue is clear for me. So can I use this historical data as an input in model-base rl or I need some additional modeling techniques to estimate stansition? $\endgroup$ – user46045 Apr 7 at 9:50
  • $\begingroup$ you could try your model with your historical data, at the least it would give it a good 'initialisation'. you could then update your model once you have some new data that the agent collects. $\endgroup$ – David Ireland Apr 7 at 9:53
  • $\begingroup$ Could you advise me some good library or tutorial for coding purpose in model-free Rl? $\endgroup$ – user46045 Apr 7 at 9:57
  • $\begingroup$ if you want to learn model-free RL then I would look for some medium articles on DQN, they are usually a good resource with well explained code. $\endgroup$ – David Ireland Apr 7 at 9:59
  • $\begingroup$ Sorry, I mean model-based. It is my mistake $\endgroup$ – user46045 Apr 7 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.