Welcome to NEAT from Scratch! This repository provides a basic implementation of the NEAT (NeuroEvolution of Augmenting Topologies) algorithm. This project aims to help you understand the core concepts of NEAT while offering a clean and straightforward codebase.
NEAT is a powerful genetic algorithm that evolves neural networks. It starts with simple structures and gradually adds complexity as it learns. This method allows for efficient exploration of the solution space, making it suitable for various applications in machine learning and artificial intelligence.
This repository serves as a foundation for anyone interested in implementing NEAT. You can find resources, examples, and tools to get started with your own projects.
- Basic NEAT Implementation: A straightforward codebase that demonstrates the NEAT algorithm.
- Game Development: Use NEAT to evolve AI for simple games.
- Deep Learning: Integrate with deep learning frameworks to enhance capabilities.
- Easy to Understand: Well-commented code and documentation to help you learn.
- Extensible: Modify and expand the implementation to suit your needs.
To get started with NEAT from Scratch, follow these steps:
-
Clone the Repository:
git clone https://github.com/tarashant/neat-from-scratch.git cd neat-from-scratch
-
Install Dependencies:
Ensure you have Python 3.x installed. You can install the required packages using pip:
pip install -r requirements.txt
-
Run the Code:
You can run the main script to see the NEAT algorithm in action:
python main.py
To use the NEAT implementation, you will need to define your own fitness function and specify how you want the neural networks to evolve. Here’s a simple example of how to set up a basic environment:
-
Define the Fitness Function:
Create a function that evaluates how well a neural network performs a task.
def fitness_function(network): # Implement your evaluation logic here return score
-
Initialize the NEAT Algorithm:
Use the provided NEAT class to set up your evolutionary process.
from neat import NEAT neat = NEAT(fitness_function) neat.run()
-
Monitor Progress:
The implementation includes logging features to track the evolution of networks over generations.
You can find examples of using NEAT in various scenarios within the examples
directory. Here are a few highlights:
- Flappy Bird AI: Evolve an AI to play Flappy Bird using NEAT.
- Simple Game AI: Create an AI that learns to navigate a maze.
- Function Approximation: Use NEAT to approximate mathematical functions.
Each example comes with its own README file to guide you through the setup and execution.
We welcome contributions to NEAT from Scratch! If you want to help improve this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
You can find the latest releases and download files from the Releases section. Make sure to check it out for updates and new features!
For questions or feedback, feel free to reach out:
- Email: tarashant@example.com
- Twitter: @tarashant
Thank you for visiting the NEAT from Scratch repository! We hope you find it useful for your projects. Happy coding!