Answers.Body: <p>You can reshape it to (12, H, W) using NumPy reshape function. By the way, this will only increase the complexity of this problem. If you want to practice RL then just get the idea from their code and try implementing on some other problem/game.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T04:04:23.093Z
Answers.LastActivityDate: 2020-11-12T04:04:23.093Z
Answers.UserDisplayName: Inaam Ilahi
Body: <p>I've been trying to learn about CNN's and reinforcement learning and I found this project to play with: <a href="https://github.com/adityajn105/flappy-bird-deep-q-learning" rel="nofollow noreferrer">https://github.com/adityajn105/flappy-bird-deep-q-learning</a></p>
  <p>I've been trying to change the code to work with RGB input instead of grayscale. Pre-precosessing part is fine, but I'm having a problem with <em>state</em> and <em>next_state</em> I guess because they're deque and when deque is appended shape is (4,H,W) because it's appended 4 times (4 frames). Problem I'm having is when I append frames to deque which are RGB it becomes something like (4,H,W,3). I tried some stuff that came to mind and that I googled and read about online, but I still had problems with dimensions. What should be done so that it works with RGB instead of grayscale?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-12T10:28:07.047Z
Comments.Text: Hello. Note that programming questions are off-topic here. We focus on theoretical aspects of AI. Take a look at https://ai.stackexchange.com/help/on-topic for more info.
Comments.UserDisplayName: nbro
Tags: <convolutional-neural-networks><dqn><double-dqn>
Title: DQN rgb input channels problem using pytorch
UserDisplayName: aiEnthusiast
ThreadText: # DQN rgb input channels problem using pytorch
  
  (Asked by: username_0 on 2020-11-12)
  
  I've been trying to learn about CNN's and reinforcement learning and I found this project to play with: <https://github.com/adityajn105/flappy-bird-deep-q-learning>
  
  I've been trying to change the code to work with RGB input instead of grayscale. Pre-precosessing part is fine, but I'm having a problem with *state* and *next\_state* I guess because they're deque and when deque is appended shape is (4,H,W) because it's appended 4 times (4 frames). Problem I'm having is when I append frames to deque which are RGB it becomes something like (4,H,W,3). I tried some stuff that came to mind and that I googled and read about online, but I still had problems with dimensions. What should be done so that it works with RGB instead of grayscale?
  
  **Tags:** convolutional-neural-networks, dqn, double-dqn
  
  > **Comments:**
  > **username_1**: Hello. Note that programming questions are off-topic here. We focus on theoretical aspects of AI. Take a look at https://ai.stackexchange.com/help/on-topic for more info.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-11-12. Score: 1
  
  You can reshape it to (12, H, W) using NumPy reshape function. By the way, this will only increase the complexity of this problem. If you want to practice RL then just get the idea from their code and try implementing on some other problem/game.
  
  
  ---
  
  