Skip to content

Instantly share code, notes, and snippets.

@andrewschreiber
Last active August 16, 2019 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewschreiber/3a9f2e80be1918d71c86f3e9048238eb to your computer and use it in GitHub Desktop.
Save andrewschreiber/3a9f2e80be1918d71c86f3e9048238eb to your computer and use it in GitHub Desktop.
from model.data import mnist_train_test_sets
from model.network import LeNet5
from saliency.vanilla_gradient import save_vanilla_gradient
# Get MNIST dataset, preprocessed
train_images, train_labels, test_images, test_labels = mnist_train_test_sets()
# Load net with 98% acc weights
net = LeNet5(weights_path="15epoch_weights.pkl")
# Generate saliency maps for the first 10 images
save_vanilla_gradient(network=net, data=train_images[:10], labels=target_labels[:10])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment