Giter Club home page Giter Club logo

geneticlearning's Introduction

Genetic Learning

twitter

Features

Space-bar (Hold)

  • Freeze's objects in their place and shows all objects if they are hidden

"R" Key (Toggle)

  • Hides all objects except for the best path from the past generation
  • Works on second generation (generation 1) and onwards

Hyper-Parameters

  • Number of balls
    • The number of balls will allow you to reach the target faster by raising your odds of having a positive mutation
    • This will cause the program to stutter depending on your computing power
  • Starting Moves
    • This hyperparameter determines the number of moves that the AI can make in order to reach the target
    • If the number of starting moves is small, the number of mutations must be higher to prevent mutations from creating objects with the same movements
  • Min-Max Velocity
    • This is the range of moves that the AI can make in its pursuit of the target
  • Generation Saved
    • This is the percentage of the current generation that is preserved onto the next generation
    • The inverse of this number multiplied by the total is the number of children that are created
  • Best Parent Saved
    • This is the percentage of children that will be mutated from the best ball in the past generation
    • The larger this number, the less random the children will be due to the lack of combination of genes from other top parents
  • Mutation Rate
    • The mutation rate is the rate/percentage of individual vectors changed per child
    • The higher this rate, the more the randomness
  • Starting X and Y
    • The starting position of the points each generation
  • Target
    • The target for the AI to reach

Learning Methods

Child Creation

The creation of a child is the most important part of the Genetic Learning Model. The three steps of child creation are parent selection, chromosome crossover, and mutation.

Parent Selection

For the selection of parents, the top {generation_saved}% of all objects will be passed on to the next generation as well as being put into the gene pool for the children of the next generation. {best_parent_saved}% of the kids will have the moves of the best object in the net.

Crossover

Genetic crossover is used to mix an attribute from each parent to create a child. In this case, the child will have the first half of its move from its first parent, and its second half of its move from its second parent. This will allow the child to test the best parts of the best objects in the net to form the best child as possible.

Mutation

The mutation of the child vectors is important for the net to be able to learn the best moves. These mutations will have a chance to push the children closer to the target than the parent, and therefore become a parent in the next generation. Allowing some children to be a direct descendant of the best parent allows for their mutated children to have higher chances to beat their parent to become the best node than their other child counterparts.

Fitness Function

The fitness function is made up of the distance of the object of the target (in pixels), plus the number of moves that it has taken the object to get to the target. For this function, it was chosen to raise the distance to the power of 5 to prioritize getting closer to the target, before limiting moves. The result of the fitness function is stored in a hashmap with the object for future use.

geneticlearning's People

Contributors

chief-zach avatar

Stargazers

 avatar  avatar

Watchers

Kostas Georgiou avatar  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.