Skip to content

tarashant/neat-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

NEAT from Scratch 🧠✨

GitHub repo size License Last Release

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.

Table of Contents

Introduction

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.

Features

  • 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.

Installation

To get started with NEAT from Scratch, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/tarashant/neat-from-scratch.git
    cd neat-from-scratch
  2. Install Dependencies:

    Ensure you have Python 3.x installed. You can install the required packages using pip:

    pip install -r requirements.txt
  3. Run the Code:

    You can run the main script to see the NEAT algorithm in action:

    python main.py

Usage

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:

  1. 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
  2. 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()
  3. Monitor Progress:

    The implementation includes logging features to track the evolution of networks over generations.

Examples

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.

Contributing

We welcome contributions to NEAT from Scratch! If you want to help improve this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes and commit them (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

You can find the latest releases and download files from the Releases section. Make sure to check it out for updates and new features!

Contact

For questions or feedback, feel free to reach out:

Thank you for visiting the NEAT from Scratch repository! We hope you find it useful for your projects. Happy coding!