https://github.com/jeremyfix/test_captum
https://github.com/jeremyfix/test_captum
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeremyfix/test_captum
- Owner: jeremyfix
- License: gpl-3.0
- Created: 2023-03-27T16:12:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-28T09:45:44.000Z (about 2 years ago)
- Last Synced: 2025-02-12T22:19:17.076Z (4 months ago)
- Language: Python
- Size: 237 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Experiments with captum for visualizing deep learning models
## Initial setup
```
python3 -m virtualenv venv
source venv/bin/activate
python -m pip install .
```## Training a model
After sourcing the virtual environmnet
```
python -m torchtmpl.main config.yml train
```With the sample configuration file, with a resnet18, you should get around 77% of validation accuracy after 100 epochs.
## Visualiation with captum
Once a model is trained, you can run the captum insights visualization tool.
The trained model is saved in the `logs` subdirectory. You need to provide the specific run you want to visualize. For example, for visualizing the run saved in `logs/resnet18_0` :
```
python -m torchtmpl.visualize logs/resnet18_0/
```That should start the flask application to which you can connect with your browser and then experiment with the visualization algorithms. An example is displayed below.
