Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

14 Commits

Repository files navigation

netflow.js

netflow.js is a javascript library for visualizing neural network structure and training on the browser.

The library is ment to be used for explanation purposes.

You can see a demo here

netflow-sample-nn.png

powered by p5.js.

Getting Started:

netflow.js is splited into multiple js files. You need to add the js files as shown below to your html file.

netflow.js depends on p5.js library for drawing on the html canvas.

<html><head><linkrel="stylesheet" type="text/css" href="css/style.css"><scriptsrc="js/lib/p5.min.js"></script><scriptsrc="js/values/style.js"></script><scriptsrc="js/values/dimes.js"></script><scriptsrc="js/utils/helper.js"></script><scriptsrc="js/core/activation.js"></script><scriptsrc="js/core/view.js"></script><scriptsrc="js/core/draw.js"></script><scriptsrc="js/core/netflow.js"></script><scriptsrc="js/builder.js"></script></head><body></body></html>

Building a Neural Network

To build a neural network, go to builder.js

Below is a sample 3-layer (input (2), hidden (2) and output (1) ) neural network. The first added layer is always the input layer, while the last is the output. Any layer added in between is a hidden layer.

functionbuild(){varnet=newNet();net.addLayer(2);// input net.addLayer(2);// hiddennet.addLayer(1);// outputreturnnet;}

Viewing the Built Neural Network

  • Open index.html in the browser to view the built network.
  • To run the forward pass and backpropagation click on the button on the top left corner or press space bar.

Adjusting the Speed

  • To adjust the learning speed go to `dimes.js.
  • Change the value of DELAY variable.
  • The value is in milliseconds.

Adding Activation Function

  • You can add an activation function to a layer while building the network in builder.js file.
functionbuild(){varnet=newNet();net.addLayer(2);// input net.addLayer(2,ReLu);// hidden with activation functionnet.addLayer(1);// outputreturnnet;}

About

netflow.js repository, javascript library for visualizing neural network structure and training on the browser.

Resources

Stars

24 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages