Skip to content

Instantly share code, notes, and snippets.

@andrewschreiber
Last active August 16, 2019 06:15
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/1ef7c8100c682ef645d12208703aaf14 to your computer and use it in GitHub Desktop.
Save andrewschreiber/1ef7c8100c682ef645d12208703aaf14 to your computer and use it in GitHub Desktop.
def save_vanilla_gradient(network, data, labels), see https://github.com/andrewschreiber/numpy-saliency
# Create a saliency map for each data point
for i, image in enumerate(data):
# Run a forward pass with an image
output = image
for l in range(len(network.layers)):
output = network.layers[l].forward(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment