pfnet / pfrl

PFRL: a PyTorch-based deep reinforcement learning library
MIT License
1.18k stars 157 forks source link

why duelingDQN does not have obversation size? #151

Closed WuMing757 closed 3 years ago

WuMing757 commented 3 years ago

I thought DuelingDQN is similar to DQN and they have same inputs. But the implementation of DuelingDQN in q_functions does not have the obs_size variable, which confuses me. How does it know the dimension of inputs? Besides, I got an Error when I replace DQN with DuelingDQN: RuntimeError: Expected 4-dimensional input for 4-dimensional weight [32, 2, 8, 8], but got 2-dimensional input of size [1, 2] instead

WuMing757 commented 3 years ago

I tried it in the train_dqn_gym.py. https://github.com/pfnet/pfrl/blob/master/examples/gym/train_dqn_gym.py

muupan commented 3 years ago

The DuelingDQN class under pfrl.q_functions is designed for Atari games. To use a dueling network architecture for other tasks, you can implement a model similar to the DuelingDQN class and pass it to the DQN agent.

WuMing757 commented 3 years ago

The DuelingDQN class under pfrl.q_functions is designed for Atari games. To use a dueling network architecture for other tasks, you can implement a model similar to the DuelingDQN class and pass it to the DQN agent.

Thank you ~