Mnist資料集分析(13) 《深度學習》

2021-08-09 13:30:07 字數 1440 閱讀 7790

mnist資料集分析

def

load_data

(): f = gzip.open('/var/tmp/mnist.pkl.gz', 'rb')

training_data, test_data = cpickle.load(f)

f.close()

return (training_data, test_data)

def():

tr_d, te_d = load_data()

training_inputs = [np.reshape(x, (784, 1)) for x in tr_d[0]]

training_results = [vectorized_result(y) for y in tr_d[1]]

training_data = zip(training_inputs, training_results)

test_inputs = [np.reshape(x, (784, 1)) for x in te_d[0]]

test_data = zip(test_inputs, te_d[1])

return (training_data, test_data)

那麼這樣處理之後,我們的資料型別為:

[([784,1],[10,1]),…,()],總返回型別為list,然後tuple中又包含tuple,子tuple中第乙個為乙個二維陣列,784*1,第二個為乙個二位陣列,10*1。

執行結果:

因此我們可以看到mnist資料集的[([784*1],i),……,()]

搭建網路之後輸出的最後一層的維度為:

MNIST資料集介紹

mnist資料集包含了6w張作為訓練資料,1w作為測試資料。在mnist資料集中,每一張都代表了0 9中的乙個數字,的大小都是28 28,且數字都會出現在的正中間。資料集包含了四個檔案 t10k images idx3 ubyte.gz 測試資料 t10k labels idx1 ubyte.gz ...

Mnist資料集簡介

1,基本概念 mnist是乙個非常有名的手寫體數字識別資料集,在很多資料中,這個資料集都會被用作深度學習的入門樣例。而tensorflow的封裝讓使用mnist資料集變得更加方便。mnist資料集是nist資料集的乙個子集,mnist 資料集可在 獲取,它包含了四個部分 1 training set...

MNIST資料集介紹

大多數示例使用手寫數字的mnist資料集 1 該資料集包含60,000個用於訓練的示例和10,000個用於測試的示例。這些數字已經過尺寸標準化並位於影象中心,影象是固定大小 28x28畫素 其值為0到1。為簡單起見,每個影象都被平展並轉換為784 28 28 個特徵的一維numpy陣列。在我們的示例...