Answers.Body: <blockquote>
    <p>Can we make the game faster so that model will be training faster?</p>
  </blockquote>
  
  <p>It depends on how much processing is required to run the simulation, how efficient that is implemented in whichever library you have loaded, and whether there is anything non-necessary for training that you can disable. Some environments for instance deliberately run "real time" so humans can appreciate the video output, and that is not necessary for training purposes (unless you want to experiment with real-time robotics).</p>
  
  <p>For OpenAI Gym, there is one thing you can usually do: Switch off the rendering. The rendering for environments like CartPole slows down each time step considerably, and unless you are learning using computer vision processing on the pixels output, the agent does not need the pictures. You may even notice during training that moving the rendering window so it is not visible will speed up the training process considerably.</p>
  
  <p>What I did for CartPole, LunarLander and a couple of similar environments is turn off rendering for 99 out of 100 episodes, and render just one of them in 100 to help me monitor progress. For Q learning, I also picked that to be a "test" episode where I stopped exploration.</p>
  
  <p>Another option for speeding up training is to run a distributed system with multiple simulations at once. You will need mechanisms to share collected data too, so it is more work, but it is another approach to take if the simulation steps are the bottleneck for training speed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-22T12:42:20.383Z
Answers.LastActivityDate: 2020-05-22T23:53:33.060Z
Answers.LastEditDate: 2020-05-22T23:53:33.060Z
Answers.UserDisplayName: Neil Slater
Body: <p>I am new in reinforcement learning. I started reading the PyTorch's documentation about the cart pole control. Whenever an agent fails, they restart the environment. </p>
  
  <p>When I run the code, the time in the game is the same as time in real life. Can we train models quicker? Can we make the game faster so that model will be training faster?</p>
  
Tags: <deep-learning><reinforcement-learning><q-learning>
Title: Can we increase the speed of training a reinforcement learning algorithm?
UserDisplayName: dato nefaridze
ThreadText: # Can we increase the speed of training a reinforcement learning algorithm?
  
  (Asked by: username_0 on 2020-05-22)
  
  I am new in reinforcement learning. I started reading the PyTorch's documentation about the cart pole control. Whenever an agent fails, they restart the environment.
  
  When I run the code, the time in the game is the same as time in real life. Can we train models quicker? Can we make the game faster so that model will be training faster?
  
  **Tags:** deep-learning, reinforcement-learning, q-learning
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-22. Score: 1
  
  > Can we make the game faster so that model will be training faster?
  
  It depends on how much processing is required to run the simulation, how efficient that is implemented in whichever library you have loaded, and whether there is anything non-necessary for training that you can disable. Some environments for instance deliberately run "real time" so humans can appreciate the video output, and that is not necessary for training purposes (unless you want to experiment with real-time robotics).
  
  For OpenAI Gym, there is one thing you can usually do: Switch off the rendering. The rendering for environments like CartPole slows down each time step considerably, and unless you are learning using computer vision processing on the pixels output, the agent does not need the pictures. You may even notice during training that moving the rendering window so it is not visible will speed up the training process considerably.
  
  What I did for CartPole, LunarLander and a couple of similar environments is turn off rendering for 99 out of 100 episodes, and render just one of them in 100 to help me monitor progress. For Q learning, I also picked that to be a "test" episode where I stopped exploration.
  
  Another option for speeding up training is to run a distributed system with multiple simulations at once. You will need mechanisms to share collected data too, so it is more work, but it is another approach to take if the simulation steps are the bottleneck for training speed.
  
  
  ---
  
  