Giter VIP home page Giter VIP logo

neuralnetworkracing's Introduction

NeuralNetworkRacing

Neural network learns how to drive a car on a track. Simple 2D simulation with pyglet & numpy.

nnr.preview.mp4

Install packages

pip install -r requirements.txt

https://github.com/TomasBrezina/NeuralNetworkRacing/blob/0ac7d81ef07f70ef9a3b9fc9e3f3e179bda86d6d/requirements.txt#L1-L3

Config

config.json

{
    "width": 1280
    "height": 720
    "friction": 0.1
    "render_timestep": 0.025 // time between frames in seconds - 0.025s = 40 FPS
    "timeout_seconds": 30 // maximum time for each gen
    "population": 40 // number of cars
    "mutation_rate": 0.6 // mutation rate after gen
}

default_nn_config.json - Default car config for new saves.

{
    "name" : "test" 
    "acceleration": 1
    "friction": 0.95
    "max_speed": 30 
    "rotation_speed": 4
    "shape": [6, 4, 3, 2] // neural network shape - do not change first and last layer
    "max_score": 0
    "gen_count": 0
}

NEURAL NETWORK

nn-architecture

EVOLUTION

Best cars in each generation are chosen to be the parents of the next, slightly mutated generation.

ENVIROMENT & TRACK GENERATION

image track-generation

neuralnetworkracing's People

Contributors

tomasbrezina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.