A high-level API for ConvNet visualizations in Keras
Project description
keravis
keravis is a high-level API for ConvNet visualizations in Keras. As of v1.0, it supports visualizations of
- Convolutional layer activations
- 2-dimensional feature space representations
- Saliency maps (vanilla backprop, guided backprop, and occlusion)
- Generated inputs that result in maximal class scores
- Patches in a set of images that maximally activate an intermediate neuron
with support for nested pretrained models.
This is a hobby project that was inspired by lecture 14 of Stanford's CS231n: Convolutional Neural Networks for Visual Recognition http://cs231n.stanford.edu/. It is not yet optimized for serious use (see keras-vis instead).
Installation
You can install keravis using pip
pip install keravis
Usage
Read the documentation
Sample Visualizations
Below are sample visualizations from a small convolutional network trained on MNIST
from keravis import feature_space
feature_space(model,X=x_test[:5000],y=y_test[:5000],kind='tsne')
from keravis import saliency_backprop
saliency_backprop(model,test_img,class_idx=7)
from keravis import saliency_guided_backprop
saliency_guided_backprop(model,test_img,class_idx=7)
from keravis import maximal_class_score_input
maximal_class_score_input(model,class_idx=5,dim=(28,28,1))
from keravis import maximally_activating_patches
maximally_activating_patches(model,'conv2d_1',X=x_test)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keravis-1.0.2.tar.gz.
File metadata
- Download URL: keravis-1.0.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af112e2c2c88a6f8d457c3b1682ea4cae48c211eb652b8825e9bdff129cb852a
|
|
| MD5 |
0e68c4dee5e1165746d00aebbcfff315
|
|
| BLAKE2b-256 |
48d9f7e7f9533125ce695ec65138248bcbc42c11195ffbffa65c14ee4496d762
|
File details
Details for the file keravis-1.0.2-py3-none-any.whl.
File metadata
- Download URL: keravis-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
977a8ec655e04df9fcbc50ed0324925fd500f97f6234b2d8cfb47cf868a28b61
|
|
| MD5 |
b7aeb1a94937526ed998c3e430cd451f
|
|
| BLAKE2b-256 |
d28f556ffaa81efd2be08f263af4d717ada31f8497ea3f0fc210b1010703c727
|