Skip to content

reward is strange #4

@birdmw

Description

@birdmw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions