簡體   English   中英

MNIST Tensorflow教程

[英]MNIST tensorflow tutorial

我正在嘗試擴展MNIST Tensorflow教程``專家的深度學習'',我試圖在其中打印y_conv的最終值(來自教程),這是我的代碼:

with sess.as_default():
    x_test=mnist.test.images[10]
    x_test=np.reshape(x_test,(-1,784))
    print(y_conv.eval(feed_dict={x:x_test,keep_prob:1}))
    print (accuracy.eval(feed_dict={x: np.reshape(mnist.test.images[10],-1,784)

我得到y_conv的怪異值:

[[18.27762222 -3.28520679 2.48342848 -4.64049053 -6.00347185
-4.08683825 -1.80674195 -2.16284728 -4.48559856 1.90175676]]

盡管當我在最后一行打印精度時,我得到的值是1.0,這意味着y_conv與y的值匹配(同樣從本教程開始。)關於可能出問題的任何想法..?

您不是在應用激活功能的情況下打印y_conv。 如果應用softmax函數,將會看到類似以下內容:

[[1, 0, 0.7ish, 0, 0, 0, 0.3ish, 0.2ish, 0, 0.7ish]]

嘗試應用激活,看看會得到什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM