Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,116 +8,6 @@ app_file: main.py
|
|
| 8 |
pinned: true
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
| 12 |
-
# Feature Visualization Generator UI
|
| 13 |
-
|
| 14 |
-
[![Python][Python-badge]][Python-url]
|
| 15 |
-
[![Pytorch][Pytorch-badge]][Pytorch-url]
|
| 16 |
-
|
| 17 |
-
A Feature Visualization (FV) generator UI. Utilizes the Gradio web framework in conjunction with the [Lucent](https://github.com/greentfrapp/lucent) (Pytorch [Lucid](https://github.com/tensorflow/lucid) framework. Aimed to help others through experiential learning, allowing them to explore different input parameters and settings and quickly see their effects.
|
| 18 |
-
|
| 19 |
-
Concepts that are used in the FV generation process such as [Channel Decorrelation and Spatial Decorelation](https://distill.pub/2017/feature-visualization/#d-footnote-8:~:text=the%20training%20data.-,Preconditioning%20and%20Parameterization,-In%20the%20previous) are discussed in the Google Brain Feature Visualization article ([Olah, et al.](https://distill.pub/2017/feature-visualization/))
|
| 20 |
-
|
| 21 |
-
Tested layers are Conv2D (Convolutional Layer) and Linear layers. Feel free to experiment, I can not guarantee that they will optimize correctly.
|
| 22 |
-
|
| 23 |
-
<!-- TABLE OF CONTENTS -->
|
| 24 |
-
<details>
|
| 25 |
-
<summary>Table of Contents</summary>
|
| 26 |
-
<ol>
|
| 27 |
-
<li>
|
| 28 |
-
<a href="#about-the-code">About The Code</a>
|
| 29 |
-
</li>
|
| 30 |
-
<li>
|
| 31 |
-
<a href="#getting-started">Getting Started</a>
|
| 32 |
-
<ul>
|
| 33 |
-
<li><a href="#prerequisites">Prerequisites</a></li>
|
| 34 |
-
<li><a href="#installation">Installation</a></li>
|
| 35 |
-
</ul>
|
| 36 |
-
</li>
|
| 37 |
-
<li>
|
| 38 |
-
<a href="#usage">Usage</a>
|
| 39 |
-
<ul>
|
| 40 |
-
<li><a href="#html-launch">HTML launch</a></li>
|
| 41 |
-
</ul>
|
| 42 |
-
</li>
|
| 43 |
-
</ol>
|
| 44 |
-
</details>
|
| 45 |
-
|
| 46 |
-
### Try it out here! --> --Insert huggingface space here--
|
| 47 |
-
|
| 48 |
-

|
| 49 |
-
|
| 50 |
-
<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
|
| 51 |
-
<a name="readme-top"></a>
|
| 52 |
-
|
| 53 |
-
<!-- ABOUT THE CODE-->
|
| 54 |
-
## About The Code
|
| 55 |
-
|
| 56 |
-
The javascript code that runs this website is broken into specific modules to help with readiblity.
|
| 57 |
-
|
| 58 |
-
* [canvas.js](scripts/canvas.js)
|
| 59 |
-
* Drawing the lines connecting each button
|
| 60 |
-
* Updating the canvas
|
| 61 |
-
* Button creation / tree traversal
|
| 62 |
-
* Button navigation
|
| 63 |
-
* Button attractions
|
| 64 |
-
* [interactions.js](scripts/interactions.js)
|
| 65 |
-
* Model input
|
| 66 |
-
* Model input interaction
|
| 67 |
-
* Orchastraction of the creation and visualization of the new model
|
| 68 |
-
* [modelparser.js](scripts/modelparser.js)
|
| 69 |
-
* Parses pytorch print model input string into a tree data structure (Via. regex)
|
| 70 |
-
* Cleaning up string input
|
| 71 |
-
* [tree.js](scripts/tree.js)
|
| 72 |
-
* Tree data structure used to store the model and navigate through
|
| 73 |
-
|
| 74 |
-
> All javascript files are located in the [scripts](scripts) folder.
|
| 75 |
-
|
| 76 |
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
| 77 |
-
|
| 78 |
-
<!-- GETTING STARTED -->
|
| 79 |
-
## Getting Started
|
| 80 |
-
To get a local copy up and running follow these simple steps.
|
| 81 |
-
|
| 82 |
-
### Prerequisites
|
| 83 |
-
|
| 84 |
-
Make sure to have these setup/installed at a minimum
|
| 85 |
-
* A modern browser that supports javascript
|
| 86 |
-
|
| 87 |
-
(Optional)
|
| 88 |
-
* A printed pytorch model output to test with
|
| 89 |
-
* This can be achieved by loading up a pytorch model and printing the model with
|
| 90 |
-
```python
|
| 91 |
-
print(<model variable here>)
|
| 92 |
-
```
|
| 93 |
-
* I will not be going into detail on how to do this as it is out of the scope of this repo.
|
| 94 |
-
|
| 95 |
-
### Installation
|
| 96 |
-
|
| 97 |
-
1. Clone the repo
|
| 98 |
-
```sh
|
| 99 |
-
git clone git@github.com:baxtrax/Model-Visualizer.git
|
| 100 |
-
```
|
| 101 |
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
| 102 |
-
|
| 103 |
-
<!-- USAGE EXAMPLES -->
|
| 104 |
-
## Usage
|
| 105 |
-
### HTML launch
|
| 106 |
-
Open the [index.html](index.html) file with a browser or deploy the website with a website deployment software.
|
| 107 |
-
|
| 108 |
-
I personally used the VScode extension `Live Server` for local development.
|
| 109 |
-
|
| 110 |
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
<!-- MARKDOWN LINKS & IMAGES -->
|
| 114 |
-
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
| 115 |
-
[Python-badge]: https://img.shields.io/badge/Python-3776AB.svg?style=for-the-badge&logo=python&logoColor=FFD343
|
| 116 |
-
[Python-url]: https://www.python.org/
|
| 117 |
-
[Pytorch-badge]: https://img.shields.io/badge/Pytorch-EE4C2C.svg?style=for-the-badge&logo=pytorch&logoColor=white
|
| 118 |
-
[Pytorch-url]: https://pytorch.org/
|
| 119 |
-
|
| 120 |
-
|
| 121 |
version https://git-lfs.github.com/spec/v1
|
| 122 |
oid sha256:8f318c9b980e22dbbcab1dc2c6344e36e3a8c6e9cfa9d7410ed9a798da7b2da1
|
| 123 |
size 137
|
|
|
|
| 8 |
pinned: true
|
| 9 |
---
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
version https://git-lfs.github.com/spec/v1
|
| 12 |
oid sha256:8f318c9b980e22dbbcab1dc2c6344e36e3a8c6e9cfa9d7410ed9a798da7b2da1
|
| 13 |
size 137
|