This line
q_update = (reward + GAMMA * np.amax(self.model.predict(state_next)[0]))
you are taking a prediction upon your next state, and then updating your current predictions with a reward over that (next) state.
q_values = self.model.predict(state)
q_values[0][action] = q_update
So you are essentially rewarding your model for the next action it takes. The reason this works is that rewards in future states are dependent upon current actions. So your model trains, but it's doing so in a strange way.
This line
q_update = (reward + GAMMA * np.amax(self.model.predict(state_next)[0]))you are taking a prediction upon your next state, and then updating your current predictions with a reward over that (next) state.
So you are essentially rewarding your model for the next action it takes. The reason this works is that rewards in future states are dependent upon current actions. So your model trains, but it's doing so in a strange way.