This is a final project created for my Computer Science Principles class using Python to implement a NEAT algorithm and dodge bullets.
This uses the pygame package to create a simple game in Java that involves dodging bullets.
I then created a NEAT algorithm in Python that allowed me to train a neural network on these targets.
I tried to implement the NEAT algorithm from scratch as I wanted to learn more about the mathematics and basics behind it rather than rely on any packages.
PLEASE DO NOT JUDGE ME BASED ON THE CODE I WAS 14 AND HATED READABILITY FOR SOME REASON
I want to shoot the me that thought Python documented itself. And the me who decided to name a python file with all of my classes "somethingreasonable" because I'm a funny boy.
And apparently every line of code is poison so now I have ternary operators and oneliners.
Plus there's legitimately a variable known as bigbecomesmall in the same file as fro.
Who in the 7 circles of hecking heck names their variable fro? It's 1 letter! Even just naming it f would do, but no, it has to be fro.
Plus this algorithm barely works! I don't even include a bias node.
You know what my thought process most likely was when I decided to cut down on one of the most important parts of a neural netwrok?
"There's so much stuff in the news about neural networks being biased when there's a literal bias node! Look at me Dad I'm smart! Just delete the bias node and everything will be fine!"
I'm scared at how it actually did work and managed to survive for >20 minutes before hitting the threshold and diverging again.
And so, I'm uploading this on my GitHub to show just how much of an idiot I am and to show "growth".
Side Note: If I lose out on a job offer because I was 16 and ranting about a project I made when I was 14, I'm going to be very sad :(.
TODO:
- Delete this
- Burn it in fire
- Cry in shame as this continues to haunt me until I'm on my deathbed.
