Git Product home page Git Product logo

neuralnet's Introduction

NeuralNet

Build Status

This is a base structure of a neural net that uses genetic algorithm.


It's mainly thought as a practical exercise for me to understand how a neural net works but will hopefully still be usable in later projects.


Number of input and output neurons, hidden layers and neurons in hiddenlayers plus bias can be specified. It tries to find the perfect weight as a double through "evolution".

Explanation

Imagine you're a GOD!

Over time you have grown lonely and are hoping to find someone to talk to, a living creature with even a spec of inteligence would suffice. Some time ago, you created humans, although they should little potential at their current state. You set yourself a goal: Try to breed a single human, who could tell you wheter two bits are the same or not.

You start with a little village, you give everyone the same four tests: is 0 and 0, 0 and 1, 1 and 0, 1 and 1 the same?

Through your booming voice coming from the skies they hear your question (it enters their input neuron), they think very hard about it (in their hidden neurons), each member thinks about it in a different way, which was determined at birth through their DNA. Then each one answers each of your four tests (with their ouput neuron). For each right answer you give them a "fitness point", which helps you keep track of everyone's score.

After they all answered, you randomly choose two of them, the higher their fitness the higher the chances of getting chosen (roulette). You put them in a room, put some romantic music on and hope they create an offspring (crossover rate). If they do, they must die (you cruel god), if they don't, they become part of the next generation. There is also a small change that some background radiation will swap one random part of a new kids DNA with a random new one (mutation rate). Kids will think in a mixture of their parents way of thinking.

You repeat this step (only make adults fuck copulate, not the kids) until your new population has the same amount of members as your old one. Then ask them the questions. Then make a new generation. Repeat until you find someone capable of solving all your tests.

Congrats, you found a new soulmate!

neuralnet's People

Contributors

jeremystucki avatar stefaniejaeger avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

neuralnet's Issues

Create different Starter classes

Create a starter for

  • XOR with Genetic Algorithm
  • Emoji with Genetic Algorithm
  • XOR with Backpropagation
  • Emoji with Backpropagation

Avoid using Cloneable

The NeuralNet class should use copy constructors instead of the Cloneable interface

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.