snake_nn
snake_nn copied to clipboard
Update snake score
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.