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)
- Synthetic maximally-activating images of classifier output
- Maximally activating patches of an intermediate neuron in a set of images
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
Usage
MNIST Examples
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 classifier_gradient_ascent
classifier_gradient_ascent(model,class_idx=5,dim=(28,28,1))
from keravis import maximally_activating_conv_features
maximally_activating_conv_features(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
keravis-1.0.1.tar.gz
(14.7 kB
view hashes)
Built Distribution
keravis-1.0.1-py3-none-any.whl
(14.5 kB
view hashes)