Last active
April 21, 2019 10:26
-
-
Save wmlba/8a5a8996a14c41e8a1e2de98ca6bfffb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
from keras.preprocessing import image | |
# if the img.png is not one of the MNIST dataset that the model was trained on, the error will be very high. | |
img = image.load_img("./img.png", target_size=(28, 28), color_mode = "grayscale") | |
input_img = image.img_to_array(img) | |
inputs = input_img.reshape(1,784) | |
target_data = autoencoder.predict(inputs) | |
dist = np.linalg.norm(inputs - target_data, axis=-1) | |
print(dist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment