tensorflowでmnistのデータをオートエンコーダに使い、
その出力結果を、元のデータと比べる際に画像として比べたいと思っています。
mnistのデータ、また、得られた結果の画像への変化、表示方法を教えていただけると嬉しいです。
https://gist.github.com/tomokishii/7ddde510edb1c4273438ba0663b26fc6
こちらのシンプルなオートエンコーダを参考にさせてもらっているのですが、
TensorFlow
1 # generate decoded image with test data 2 test_fd = {x: mnist.test.images, y_: mnist.test.labels} 3 decoded_imgs = decoded.eval(test_fd) 4 print('loss (test) = ', loss.eval(test_fd)) 5 6x_test = mnist.test.images 7 8n = 10 # how many digits we will display 9plt.figure(figsize=(20, 4)) 10for i in range(n): 11 # display original 12 ax = plt.subplot(2, n, i + 1) 13 plt.imshow(x_test[i].reshape(28, 28)) 14 plt.gray() 15 ax.get_xaxis().set_visible(False) 16 ax.get_yaxis().set_visible(False) 17 18 # display reconstruction 19 ax = plt.subplot(2, n, i + 1 + n) 20 plt.imshow(decoded_imgs[i].reshape(28, 28)) 21 plt.gray() 22 ax.get_xaxis().set_visible(False) 23 ax.get_yaxis().set_visible(False) 24 25plt.savefig('mnist_ae1.png') 26
最後のこちらの部分がどういう処理を行っているのか理解できません。。。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。