Skip to content

FahimeMirveisi/AI_Snake

Repository files navigation

AI_Snake (Implemented with ML)

Classic snake game with machine learning

MY Snake

Description

This is a project to train a neural network to play the game snake. The neural network is trained using MLP algorithm. This project is written in python and uses the arcade library for the game.

How to install

pip install -r requirements.txt

How to run

  1. Collect data and generate dataset
python generate_dataset.py

Press 'Q' on keyboard to stop collecting data and save collected dataset.

  1. Train neural network
python train.py
  1. Play game
python main_ml.py

Loss and accuracy

MY Snake MY Snake

Releases

No releases published

Packages

No packages published

Languages