Giter Site home page Giter Site logo

mhhamdan / netflow.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hmkcode/netflow.js

0.0 0.0 0.0 373 KB

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

License: MIT License

CSS 0.58% HTML 2.52% JavaScript 96.90%

netflow.js's Introduction

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>
    <link rel="stylesheet" type="text/css" href="css/style.css">
    
    <script src="js/lib/p5.min.js"></script>
    <script src="js/values/style.js"></script>
    <script src="js/values/dimes.js"></script>
    <script src="js/utils/helper.js"></script>
    <script src="js/core/activation.js"></script>
    <script src="js/core/view.js"></script>
    <script src="js/core/draw.js"></script>
    <script src="js/core/netflow.js"></script>
    <script src="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.

function build(){
    var net = new Net();

    net.addLayer(2); // input 
    net.addLayer(2); // hidden
    net.addLayer(1); // output

    return net;

}

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.
function build(){
    var net = new Net();

    net.addLayer(2); // input 
    net.addLayer(2, ReLu); // hidden with activation function
    net.addLayer(1); // output

    return net;

}

netflow.js's People

Contributors

hmkcode avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.