# Can the rewards be matrices when using DQN?

I have a basic question. I'm working towards developing a reward function for my DQN. I'd like to train an RL agent to edit pixels on an image. I understand that convolutions are ideal for working with images, but I'd like to observe the agent doing it in real-time. Just a fun side project.

Anyway, to encourage an RL agent to craft a specific image I'm crafting a reward function that returns a $$N \times N$$ dimensional matrix. Which represents the distance between the state of the target image (RGB values for each pixel location) and the image the agent crafted.

Generally speaking, is it better for rewards to be a scalar, or is using matrices okay?

• How would you adapt DQN to work with vectorized rewards? Note that I changed the title to be what I think is your actual question. If that's not your actual question, let us know what it is. – nbro Feb 2 at 16:00
• See also this and this. – nbro Feb 2 at 22:28