GithubHelp home page GithubHelp logo

qaz734913414 / snakeneuralnetworkjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elyx0/snakeneuralnetworkjs

0.0 2.0 0.0 7.59 MB

Neuroevolution of Neural Network for snakes in the Browser

JavaScript 83.83% CSS 3.29% HTML 12.88%

snakeneuralnetworkjs's Introduction

snakeneuralnetworkjs Build Status

DEMO: https://snakeneuralnetwork.herokuapp.com/

Neuroevolution of Neural Network of snakes in the Browser.

This is a demonstration of evolving a neural network thanks to genetics algorithms in the browser using a multilayer perceptron (150-15-15-1).

The initial population contains 36 individuals, each assigned a different genome. They will fight following a round-robin tournament. At the end the top 7 are kept alive, and the remaining 29 are created by breeding from the 7.

Each snake has 50 sensors, each reporting 3 inputs:

  1. The distance the sensor has hit something normalized between 0 and 1
  2. 1 if this sensor touched the enemy body
  3. 1 if this sensor touched the enemy body

Screenshot

Snakes fighting:

Snakes

Sensors:

Snakes

Green: The sensor touched the enemy body Yellow: The sensor did not report any activity Red: The sensor is hitting a wall or its own body Blue: The sensor is touching the enemy head

Install

  • Note: requires a node version >= 6 and an npm version >= 3.

First, clone the repo via git:

git clone https://github.com/elyx0/snakeneuralnetworkjs.git your-project-name

And then install dependencies.

$ cd your-project-name && npm install

💡 you will need to run npm run build for publishing like for heroku

Run

$ node server.js

Then head to localhost:8080 in the browser.

Testing

$ npm run test

snakeneuralnetworkjs's People

Contributors

elyx0 avatar

Watchers

James Cloos avatar 新无止竞博客 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.