Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

nickarchive/python-vnetwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VNetwork

VNetwork is a Python library which helps you build a neural network and train it.

Yeah you could use Tensorflow, Keras, PyTorch or scikit-learn but I wanted to write my own library, for fun.

Warning

This is a perfect example of what not to do. Only thing you can take from this, is maybe the code style. Don't build your neural networks like this. It is very inefficient. - Nick from the future

Use case

single-layer-shape-reco is a Python program that uses VNetwork module to differentiate rectangles from circles.

Here input layers are arranged in 32x32 grid and their colored by their state value which can be anything from 0 (black) to 1 (white). On the right we have another 32x32 grid which shows the biases of nodes. Trained neural network is presented with an "image" of a rectangle and the output neuron value is set to 1: Preview

And here the neural network is presented with a circle and the output neuron is set to 0: Preview

Also dont look at the code for that (its bad). Its just a proof of concept.

Usage

VNetwork has Network class which takes layerplan argument on initialization. layerplan aregument is a 3D array of lists that contain arguments for creating a Node object.

Heres an example of creating 3 layer neural network:

Network(
    layerplan = [
        [[], []],
        [[], [], []],
        [[]]
    ]
)

Every item inside the layerplan represents a layer. And every item inside every "layer" represents a Node which is a class in vnetwork.py. Node class takes couple arguments on initialization. In the layerplan list we can override the default arguments.

Heres an example of creating a 3 layer neural network with all node's state set to 4:

Network(
    layerplan = [
        [[4], [4]],
        [[4], [4], [4]],
        [[4]]
    ]
)

Also I made a fun little presentation on YouTube.

About

VNetwork library for Python to help with neural networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published