Skip to content

A neural network library + playground, inspired by playground.tensorflow.org; less competently written, but hey, you can draw your own shapes.

License

Notifications You must be signed in to change notification settings

Sonotsugipaa/pixnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixnn

An Amatorial Neural Network Playground

Pixnn is an OpenGL application that allows the user to draw shapes on a grid, or canvas, by adding blue or red points: a neural network will do all the dirty work and draw a light blue / orange image based on your inputs... or orange spikes, depending on its mood.

Mouse And Key Mappings

Key / Button Action
Left Mouse Button Add Red Point
Right Mouse Button Add Blue Point
Middle Mouse Button Add White Point
SHIFT Half-Strength Modifier
PAGE-UP Increase Learning Rate
PAGE-DOWN Decrease Learning Rate
HOME Increase Granularity
END Decrease Granularity
DELETE Undo last point
Q / ESC Quit
R Reset AI
G Reset Canvas
T Toggle Show Canvas
D Toggle Derivatives

The mouse buttons can be held, in order to continuously add points;
beware, adding multiple points (or holding a mouse button without moving the cursor) will place duplicate training samples and will affect the results - more samples in a small zone means more training cycles will be performed there, and less training cycles will be performed elsewhere.

Requirements and Dependencies

Pixnn is built around OpenGL 1.5: compiling it and running it require the GLFW3 and GLEW libraries (either static or dynamic), GNU Make and the C++ compiler (and its STL) from GCC, a.k.a. g++.

The following packages should provide the necessary libraries:

  • Pacman (Arch Linux)
    • gcc
    • make
    • glew
    • glfw-x11
  • dpkg (Debian)
    • g++ (GCC version must be > 7)
    • make
    • libglfw3
    • libglew-dev
    • libglew2.1

Compiling and Linking

The application's make target is bin/nncli.

Additionally, the makefile provides a phony target, reset, to remove all compiled or linked binaries: it's a shortcut for deleting all files in bin/, all .o files under build/* and all .a files in lib/.

Notes

  • The neural network is neither multi-threaded nor throttled: it will use all the CPU time it can get from a single thread for learning, and an additional throttled thread to compute each pixel of the canvas with a frequency of 60 Hz.
  • OpenGL and the C++ STL make memory-profiling difficult with valgrind, therefore some memory leaks may exist within the main application.

About

A neural network library + playground, inspired by playground.tensorflow.org; less competently written, but hey, you can draw your own shapes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published