def plot_test_results(net, test_inputs):
 fig = plt.figure()
 ax = fig.add_subplot(111)
 images_in = [test_inputs[j].reshape((-1), 28) for j in range(10)]
 images_out = [net.feedforward(test_inputs[j]).reshape((-1), 28) for j in range(10)]
 image_in = np.concatenate(images_in, axis=1)
 image_out = np.concatenate(images_out, axis=1)
 image = np.concatenate([image_in, image_out])
 ax.matshow(image, cmap=matplotlib.cm.binary)
 plt.xticks(np.array([]))
 plt.yticks(np.array([]))
 plt.show()

def plot_test_results ( net , test_inputs ) : fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) images_in = [ test_inputs [ j ] . reshape ( ( - 1 ) , 28 ) for j in range ( 10 ) ] images_out = [ net . feedforward ( test_inputs [ j ] ) . reshape ( ( - 1 ) , 28 ) for j in range ( 10 ) ] image_in = np . concatenate ( images_in , axis = 1 ) image_out = np . concatenate ( images_out , axis = 1 ) image = np . concatenate ( [ image_in , image_out ] ) ax . matshow ( image , cmap = matplotlib . cm . binary ) plt . xticks ( np . array ( [ ] ) ) plt . yticks ( np . array ( [ ] ) ) plt . show ( )
plot the results after passing the first ten test mnist digits through the autoencoder net .