title: Why does my agent always takes a same action in RL?
body: <p>0</p>
  <p>I'm trying to reproduce the work in the paper Demand Response for Home Energy Management Using Reinforcement Learning and Artificial Neural Network. I want to optimize the power consumption for home appliances. The action space is a different power rating for home appliances. My reward function is = -(power rating *electricity price).</p>
  <p>I have trained an RL agent using DQN algorithm on Matlab. I have action space that the agent should select from, but my agent always takes the same action irrespective of state. I have checked my reward function and the algorithm does not select the action with the highest reward. Anyone can think of why is the agent behaving this way?</p>
  <p>My code:</p>
  <p><a href="https://i.stack.imgur.com/vzYvQ.png" rel="nofollow noreferrer">enter image description here</a>
  <a href="https://i.stack.imgur.com/kC1md.png" rel="nofollow noreferrer">enter image description here</a>
  What I'm getting while training:</p>
  <p><a href="https://i.stack.imgur.com/cIJD0.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>And my agent always takes the same power rating regardless of the state (electricity price). Why?</p>