https://github.com/cau777/dinosaur-game-ai
AI to play Google Chrome Dinosaur Game made with neural networks and based on evolution.
https://github.com/cau777/dinosaur-game-ai
ai ais evolutionary-algorithms neural-networks
Last synced: 7 months ago
JSON representation
AI to play Google Chrome Dinosaur Game made with neural networks and based on evolution.
- Host: GitHub
- URL: https://github.com/cau777/dinosaur-game-ai
- Owner: cau777
- License: mit
- Created: 2021-04-21T18:14:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-30T21:11:05.000Z (over 4 years ago)
- Last Synced: 2025-01-29T22:16:17.909Z (8 months ago)
- Topics: ai, ais, evolutionary-algorithms, neural-networks
- Language: C#
- Homepage:
- Size: 1.41 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dinosaur-Game-AI
AI to play Google Chrome Dinosaur Game made with neural networks and based on evolution.
## How the Algorithm Works
The program generates the specified number of dinosaurs and assigns AIs with random weights and biases.
These randomly generated AIs compete, and the one with the best score passes its weights and biases to all the other AIs. Random mutations happen in this process.
Most of the process happens on the GPU, so the program supports hundreds of AIs.## How the AI works
The AI is created with neural networks. This model is inspired by the behavior of the human brain. There are several layers and, in each layer, neurons that are connected to the ones in the next layer. For this project, I used a simple model with four layers constituted by seven, six, four, and three neurons.
Each neuron has a bias value, and each connection between neurons has a weight value. These values go from -2 to 2.
The first layer represents the inputs, and the last one describes the outputs. In this case, the neuron with the highest value shows the decision the AI made.
Another critical part of this type of AI is the activation function. I chose "1 / (1 + e⁻ˣ)".
To know the value of a neuron, the program sums the bias with the values of all neurons in the previous layers multiplied by their respective weights. After that, it applies the activation function.