Skip to content

HarjotSingh8/machine-learning-p5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evolutionary Machine Learning Algorithm in p5.js

This project is a demonstration of Evolutionary Machine Learning Algorithm running purely in JavaScript.

Instructions

Open this live link in your browser to get to a sandbox and refer to these steps if required:

  1. In this sandbox you can click anywhere on the grey area to select a starting point for your entities.

  2. Once you have selected the starting point, you can click or drag from the area around it to create a path (made of square blocks) for the entities to follow.

Setting a starting point and creating a path

Starting

  1. Once you have created a path, you can click on the start button on top left corner to spawn entities, these entities will learn from performing completely random moves to traversing the path improving slowly generation over generation.
Start Button

Start Button

First Generation

First Generation

Examples and Findings

  • Examples

Generation Progress
First Generation First Gen
Generation 2-5 First Gen
Generation 6 First Gen
  • Findings

Randomisation over Time

As the model trains, a huge reduction in randomisation can be seen
Stage Randomisation
First Gen First Gen
Early Generations First Gen
Moderately Trained First Gen
Well Trained First Gen

Installation

No installation is required.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

p5.js

p5.js was used for the demostration.

p5.js is a JavaScript library for creative coding, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! p5.js is free and open-source because we believe software, and the tools to learn it, should be accessible to everyone.

Check out p5.js!

License

MIT