$ xvfb-run -s "-screen 0 1400x900x24" jupyter notebook
import matplotlib.pyplot as plt
%matplotlib inline
def show_state(env, step=0):
# Backprop to get gradient | |
label_one_hot = labels[i] | |
dy = np.array(label_one_hot) | |
for l in range(len(network.layers)-1, -1, -1): | |
dout = network.layers[l].backward(dy) | |
dy = dout |
# Create a saliency map for each data point | |
for i, image in enumerate(data): | |
# Forward pass on image | |
# Note: the activations from this are saved on each layer | |
output = image | |
for l in range(len(network.layers)): | |
output = network.layers[l].forward(output) | |
# Backprop to get gradient | |
label_one_hot = labels[i] |
# Create a saliency map for each data point | |
for i, image in enumerate(data): | |
# Forward pass on image | |
# Note: the activations are saved on each layer | |
output = image | |
for l in range(len(network.layers)): | |
output = network.layers[l].forward(output) | |
# Backprop to get gradient | |
label_one_hot = labels[i] |
#!/bin/sh | |
# See video https://www.youtube.com/watch?v=7PO27i2lEOs | |
set -e | |
command_exists () { | |
type "$1" &> /dev/null ; | |
} |