• Stars
    star
    688
  • Rank 63,076 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🧬 Training the car to do self-parking using a genetic algorithm

🧬 Self-Parking Car Evolution

Training the car to do self-parking using a genetic algorithm.

Self-Parking Car Evolution

This is an experimental project with the aim to learn the basics of how genetic algorithm works by teaching the cars to do the self-parking. The evolution process is happening directly in the browser. You may check the evolution source-code (in TypeScript) or read the explanation of how it works in my blog-post.

At the beginning of the evolution the generation of cars has random genomes which make them behave something like this:

Self-parking cars at the beginning of the evolution

On the 40th generation the cars start learning what the self-parking is and start getting closer to the parking spot (although hitting the other cars along the way):

Self-parking car in

Another example with a bit more challenging starting point:

Self-parking car in

Genetic Source-Code

The β‰ˆ92% of the code in this repository relates to the UI logic (3D simulation of the cars world, form controls for the evolution training process, etc.).

However, the actual code that implements a genetic algorithm takes less than <500 lines of code.

Development Details

The project is a React application written on TypeScript. Styled with BaseWeb.

The 3D world simulation is made with Three.js library using @react-three/fiber wrapper. The physics is simulated with Cannon.js using cannon-es wrapper.

The whole evolution simulation is happening directly in the browser.

To launch the project, fork/clone it and run the following commands:

npm install
npm run start

The website will be available on http://localhost:3000/self-parking-car-evolution.

Hints:

  • You may upload one of the pre-trained checkpoints to avoid starting the evolution from scratch.
  • Use the ?debug=true URL param to see the FPS performance monitor and debugging logs in the console (i.e. http://localhost:3000/self-parking-car-evolution?debug=true).
  • Training progress is being saved to the local storage for each generation (not for each batch/group).

Author

More Repositories

1

javascript-algorithms

πŸ“ Algorithms and data structures implemented in JavaScript with explanations and links to further readings
JavaScript
173,558
star
2

homemade-machine-learning

πŸ€– Python examples of popular machine learning algorithms with interactive Jupyter demos and math being explained
Jupyter Notebook
21,617
star
3

learn-python

πŸ“š Playground and cheatsheet for learning Python. Collection of Python scripts that are split by topics and contain code examples with explanations.
Python
14,972
star
4

state-of-the-art-shitcode

πŸ’©State-of-the-art shitcode principles your project should follow to call it a proper shitcode
4,789
star
5

nano-neuron

πŸ€– NanoNeuron is 7 simple JavaScript functions that will give you a feeling of how machines can actually "learn"
JavaScript
2,192
star
6

promote-your-next-startup

πŸš€ Free resources you may use to promote your next startup
2,000
star
7

js-image-carver

πŸŒ… Content-aware image resizer and object remover based on Seam Carving algorithm
TypeScript
1,504
star
8

machine-learning-experiments

πŸ€– Interactive Machine Learning experiments: πŸ‹οΈmodels training + 🎨models demo
Jupyter Notebook
1,461
star
9

machine-learning-octave

πŸ€– MatLab/Octave examples of popular machine learning algorithms with code examples and mathematics being explained
MATLAB
796
star
10

use-position

🌍 React hook usePosition() for fetching and following a browser geolocation
JavaScript
298
star
11

covid-19

πŸ“ˆ Coronavirus (COVID-19) dashboard to show the dynamics of Π‘oronavirus distribution per country
JavaScript
265
star
12

nodejs-master-class

πŸ›  This repository contains the homework assignment for Node.js Master Class that is focused on building a RESTful API, web app GUI, and a CLI in plain Node JS with no NPM or 3rd-party libraries
JavaScript
235
star
13

angular-library-seed

🌾 Seed project for Angular libraries that are AOT/JIT compatible and that use external SCSS-styles and HTML-templates
TypeScript
203
star
14

okso-app

✍🏻 The drawing app to express, grasp, and organize your thoughts and ideas. Draw to explain. Draw to grasp.
198
star
15

links-detector

πŸ“– πŸ‘†πŸ» Links Detector makes printed links clickable via your smartphone camera. No need to type a link in, just scan and click on it.
TypeScript
184
star
16

trekhleb.github.io

🧬 My personal website with a list of my projects that help people learn and blog posts about life, web-development, and machine-learning.
TypeScript
176
star
17

hello-docker

🐳 Example Docker project that is used as illustration for automated continuous delivery flow with DockerCloud and DigitalOcean
Python
48
star
18

micrograd-ts

πŸ€– A TypeScript version of karpathy/micrograd β€” a tiny scalar-valued autograd engine and a neural net on top of it
TypeScript
42
star
19

giphygram

πŸ”Ž Experimental React application for searching GIF images on GIPHY
JavaScript
24
star
20

vscode-search-tree

πŸ”Ž (Draft!) VSCode extension to show the search results in a tree view
TypeScript
21
star
21

trekhleb

πŸ‘¨πŸ»β€πŸ’» My GitHub profile intro
15
star