Skip to content

baxtrax/Model-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model Visualizer

HTML CSS JS

Easy to use website that dynamically gives a view of a model. Additonally can show the feature visualizations of a network when hovering over layers that have feature visualizations generated.

The website will default to a Resnet18 (Kaiming He et al.) network that has been modified to work with the CIFAR10 (Alex Krizhevsky) dataset. Additionally all layers that are Conv2d layers will show a feature visualization on hover.

Table of Contents
  1. About The Code
  2. Getting Started
  3. Usage

image

About The Code

The javascript code that runs this website is broken into specific modules to help with readiblity.

  • canvas.js
    • Drawing the lines connecting each button
    • Updating the canvas
    • Button creation / tree traversal
    • Button navigation
    • Button attractions
  • interactions.js
    • Model input
    • Model input interaction
    • Orchastraction of the creation and visualization of the new model
  • modelparser.js
    • Parses pytorch print model input string into a tree data structure (Via. regex)
    • Cleaning up string input
  • tree.js
    • Tree data structure used to store the model and navigate through

All javascript files are located in the scripts folder.

(back to top)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Make sure to have these setup/installed at a minimum

  • A modern browser that supports javascript

(Optional)

  • A printed pytorch model output to test with
    • This can be achieved by loading up a pytorch model and printing the model with
    print(<model variable here>)
    • I will not be going into detail on how to do this as it is out of the scope of this repo.

Installation

  1. Clone the repo
    git clone git@github.com:baxtrax/Model-Visualizer.git

(back to top)

Usage

HTML launch

Open the index.html file with a browser or deploy the website with a website deployment software.

I personally used the VScode extension Live Server for local development.

(back to top)

About

Easy to use website that dynamically gives a view of a pytorch model

Topics

Resources

License

Stars

Watchers

Forks