snake_nn icon indicating copy to clipboard operation
snake_nn copied to clipboard

Update snake score

Open p-matt opened this issue 4 years ago • 0 comments

Yo, Im pretty sure that your script needs to update the previous snake score when you generate training data (initial_population())

if score > prev_score or food_distance < prev_food_distance:
   training_data.append([self.add_action_to_observation(prev_observation, action), 1])

But here, you don't update the prev_score when condition is satisfied.
Its a big mistake I guess, because the condition will be satisfied in next steps even if it was a "bad" move from the snake since score > prev_score should be true.

p-matt avatar Jan 02 '21 14:01 p-matt