🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

keravis

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keravis

A high-level API for ConvNet visualizations in Keras

1.0.2
PyPI
Maintainers
1

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')

MNIST_TSNE

from keravis import saliency_backprop
saliency_backprop(model,test_img,class_idx=7)

saliency_1

from keravis import saliency_guided_backprop
saliency_guided_backprop(model,test_img,class_idx=7)

saliency

from keravis import maximal_class_score_input
maximal_class_score_input(model,class_idx=5,dim=(28,28,1))

gradient_ascent_5

from keravis import maximally_activating_patches
maximally_activating_patches(model,'conv2d_1',X=x_test)

MNIST_CONV_FEATURES

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts