<commit_before># What is crAIg?
crAIg is a self-teaching AI built by [<NAME>](http://joecrozier.ca) and [<NAME>](http://savas.ca) for [YHack](http://yhack.org).

# How does crAIg work?
crAIg is a uses Neuroevolution to learn how to play Mario. Neuroevolution is the artificial evolution of neural networks through genetic algorithms. In simpler terms, crAIg evolves much like species do, selecting for success every generation.

crAIg started out knowing nothing about Mario, or even what a game is. All crAIg starts with is a list of inputs and outputs, and he uses these to learn how to play Mario.

# NEAT Algorithm
The algorithm that crAIg uses to evolve is called "NEAT", based off of this paper published in the MIT Press Journals by <NAME> and <NAME>: [Evolving Neural Networks through Augmented Topologies](http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf). A perspective on NEAT from a programmer's perspective will be in a blog post coming soon at [medium.com/@savas](https://medium.com/@savas).

The code for the NEAT algorithm is all held within the NEAT folder. Check it out! To modify the way that crAIg breeds and selects, you can modify the NEAT/config.lua file.

# How to run crAIg
1. Clone this repo
2. Download [FCEUX](www.fceux.com/web/download.html)
3. Open FCEUX and click File -> Open ROM -> runtime/Super Mario Bros. (Japan, USA).nes
4. Press enter to start the game (wait for mario to be standing on the ground)
5. File -> Lua -> New Lua Script Window
6. Browse... "crAIg.lua"
7. Click "Run"
8. Watch crAIg learn!<commit_msg>Updated README to include the blog post<commit_after># What is crAIg?
crAIg is a self-teaching AI built by [<NAME>](http://joecrozier.ca) and [<NAME>](http://savas.ca) for [YHack](http://yhack.org).

# How does crAIg work?
crAIg is a uses Neuroevolution to learn how to play Mario. Neuroevolution is the artificial evolution of neural networks through genetic algorithms. In simpler terms, crAIg evolves much like species do, selecting for success every generation.

crAIg started out knowing nothing about Mario, or even what a game is. All crAIg starts with is a list of inputs and outputs, and he uses these to learn how to play Mario.

# NEAT Algorithm
The algorithm that crAIg uses to evolve is called "NEAT", based off of this paper published in the MIT Press Journals by <NAME> and <NAME>: [Evolving Neural Networks through Augmented Topologies](http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf). An indepth explanation to the implementation of the NEAT algorithm from a programmers perpsective can be found [here](https://medium.com/@savas/craig-using-neural-networks-to-learn-mario-a76036b639ad).

The code for the NEAT algorithm is all held within the NEAT folder. Check it out! To modify the way that crAIg breeds and selects, you can modify the NEAT/config.lua file.

# How to run crAIg
1. Clone this repo
2. Download [FCEUX](www.fceux.com/web/download.html)
3. Open FCEUX and click File -> Open ROM -> runtime/Super Mario Bros. (Japan, USA).nes
4. Press enter to start the game (wait for mario to be standing on the ground)
5. File -> Lua -> New Lua Script Window
6. Browse... "crAIg.lua"
7. Click "Run"
8. Watch crAIg learn!
{'fraction_non_alphanumeric': 0.08546475358702432, 'fraction_numerical': 0.008733624454148471, 'mean_word_length': 4.19773095623987, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3643448', 'n_tokens_mistral': 1003, 'n_tokens_neox': 947, 'n_words': 463}