项目作者: morphx666

项目描述 :
Simple Perceptron implementation
高级语言: C#
项目地址: git://github.com/morphx666/Perceptron.git
创建时间: 2017-07-06T21:54:24Z
项目社区:https://github.com/morphx666/Perceptron

开源协议:

下载


Perceptron

Simple Perceptron implementation

Image of Yaktocat

An implementation of a simple perceptron, based on the tutorials (1 and 2) from The Coding Train by Daniel Shiffman.

How does it work?

A more complete and detailed answer to this question can be obtained by watching the tutorials linked above.

A line is created inside a cartesian plane, following the y=mx+b equation.
Then, a number of points are scattered across the plane, in a random fashion. The perceptron then starts adjusting its weights by asking each point if it appears on one side (black dots) or the other (white dots) from the line.

Using this simple logic, the perceptron can find the original line’s parameters in (usually) several thousands of iterations. Of course, the number of points will greatly affect the final accuracy of the “deduced” line.

Please note that some parameters in the implementation have been intentionally altered to enhance the experience of watching the algorithm work, by slowing it down.

Legend information

The legend on the top/left corner displays the following information:

  • The weights’ values (w1, w2 and w3)
  • The user defined line equation (blue)
  • The line equation “found” by the algorithm (red)
  • The frames/second
  • The number of times (iterations) the training algorithm has been executed
  • The total runtime

The dots on the screen

Each dot (represented by a 16x16 circle) uses four colors to represent six different states:

  • White dots appear on one side of the line
  • Black dots appear on the other side of the line
  • Dots with an inner and smaller green circle indicate dots that appear on the same side of both, the pre-defined line (blue) and the line found by the algorithm (red)
  • Dots with an inner red circle indicate dots on the wrong side of the algorithm’s line