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
Try it out here! --> https://baxtrax.github.io/Model-Visualizer/
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.
To get a local copy up and running follow these simple steps.
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.
- Clone the repo
git clone git@github.com:baxtrax/Model-Visualizer.git
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.