GithubHelp home page GithubHelp logo

usnistgov / nn-calculator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tensorflow/playground

8.0 3.0 3.0 13.34 MB

Play with neural network calculator!

Home Page: https://pages.nist.gov/nn-calculator

License: Apache License 2.0

TypeScript 80.42% HTML 10.58% CSS 8.82% JavaScript 0.18%

nn-calculator's Introduction

Neural network calculator for designing trojan detectors in deep learning models

Neural network calculator (NN Calculator) is an interactive visualization of neural networks that operates on datasets and NN coefficients as opposed to simple numbers.

Main features

  • The standard calculator symbols MC, MR, M+, M-, and MS are used for clearing, retrieving, adding, subtracting, and setting memory with datasets (training and testing subsets) and NN coefficients (biases and weights) with preceding D or NN. In addition, the datasets can be modified by adding multiple levels of noise or nine embedding types of trojans, and NNs can be modified by constructing layers and nodes or manually changing coefficients.

  • The main operations on datasets and NN are train, inference, inefficiency, and robustness calculations with their corresponding mean squared error (MSE) for training, testing and inference sub-sets, neuron state histograms, and derived measurement statistics. Furthermore, one can perform NN model averaging and dataset regeneration in order to study variability over multiple training sessions and random data perturbations.

  • The remaining settings are viewed as characteristics of datasets (noise, trojan), parameters of NN modeling algorithm (Learning Rate, Activation Function, Regularization, Regularization Rate), and parameters of NN training algorithm (Train to Test Ratio, Batch Size). In order to keep track of all settings, one can save all NN parameters and NN coefficients, as well as all inefficiency and robustness analytical results.

  • The inefficiency calculation is defined via modified Kullback-Liebler (KL) divergence applied to a state histogram extracted per layer and per class label. NN Calculator reports also the number of non-zero histogram bins per class, the states and their counts per layer and per label for most and least frequently occurring states, the number of overlapping states across class labels and their corresponding states, and the bits in states that are constant for all used states for predicting a class label. The robustness calculation computes average and standard deviation of inefficiency values acquired over three runs and 100 epochs per run.

Implementation

  • NN Calculator is written in TypeScript using d3.js and Plotly.js.
  • It is built on top of the GitHub project called Tensorflow playground.

Disclaimer

National Institute for Standards and Technology (NIST) Software Disclaimer

For technical details about NN calculator for designing trojan detectors, see the paper:

Peter Bajcsy, Nicholas J. Schaub, Michael Majurski, Neural Network Calculator for Designing Trojan Detectors, arXiv:2006.03707v1 [cs.CR] 5 Jun 2020; link to PDF

For research purposes, see the GitHub deployment and repositories of Neural Network Calculator:

Development

To run the visualization locally, run:

  • npm i to install dependencies
  • npm run build to compile the app and place it in the dist/ directory
  • npm run serve to serve from the dist/ directory and open a page on your browser.

For a fast edit-refresh cycle when developing run npm run serve-watch. This will start an http server and automatically re-compile the TypeScript, HTML and CSS files whenever they change.

nn-calculator's People

Contributors

5volts avatar brokenairplane avatar danbri avatar dependabot[bot] avatar dsmilkov avatar endash avatar gortmctabs avatar hinaser avatar jhemarcos avatar mahnerak avatar mldangelo avatar pbajcsy avatar piperchester avatar primetang avatar shancarter avatar urish avatar zhmushan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.