Skip to content

MarageDev/Simple-Neural-Network-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Simple-Neural-Network-Visualizer

This is a simple Python program to visualize neural networks ( only the one where each perceptron of a layer are linked to all the other ones of the next layer ).

This program was made just to test pygame and as I was learning more about neural networks, I wanted to try to create a neural network visualizer

Requirements

The program requires PyGame, it can be installed like that :

pip install pygame

You can find more information on the website https://www.pygame.org/

Information

Configuration of the layers in the neural network

You can change the number of perceptrons and the number of layers by editing the variable nn_layers ( neural network layers ), by default it is set to :

nn_layers    = [2,5,3,8,2,1]    # Layers of the neural network

Note : the color of the connections have random colors ( red or green )

Spacing between the layers and perceptrons

The horizontal and vertical spacing of the neural network can be modified to make it more "read-able" with the variables nn_h_spacing and nn_v_spacing:

nn_h_spacing = 120              # Horizontal spacing between the perceptrons of the neural network
nn_v_spacing = 60               # Vertical spacing between the perceptrons of the neural network

Position of the neural network

Its position can be changed with the variable nn_origin :

nn_origin    = (100, resolution[1]/2)     # Center of the neural network ( x anchor is at the left of the neural network and y anchor is at the center of the neural network)

Additional information

Most of the parts of the code are commented.

Possible updates

  • Use of martices to display it instead of an array of integers
  • Addition of a real neural network logic and not only a visualization of it

Releases

No releases published

Packages

No packages published

Languages