資源簡介
該壓縮包包括了TensorFlow基于CIFAR10數據集的卷積神經網絡的代碼實現,以及多個測試結果的測試圖片。
代碼片段和文件信息
#?coding:?utf-8
#?Python2
#?from?__future__?import?print_function?division
#?import?tensorflow?as?tf
#?import?numpy?as?np
#?import?matplotlib.pyplot?as?plt
#?import?cPickle?as?pickle
#?import?seaborn
#?Python3
import?tensorflow?as?tf
import?numpy?as?np
import?matplotlib.pyplot?as?plt
import?_pickle?as?pickle
import?seaborn
def?unpickle(filename):
????‘‘‘解壓數據‘‘‘
????#?Python2
????#?with?open(filename)?as?f:
????#?????d?=?pickle.load(f)
????#?????return?d
????
????#?Python3
????with?open(filename?‘rb‘)?as?f:
????????d?=?pickle.load(f?encoding=‘latin1‘)
????????return?d
def?onehot(labels):
????‘‘‘one-hot?編碼‘‘‘
????n_sample?=?len(labels)
????n_class?=?max(labels)?+?1
????onehot_labels?=?np.zeros((n_sample?n_class))
????onehot_labels[np.arange(n_sample)?labels]?=?1
????return?onehot_labels
#?訓練數據集
data1?=?unpickle(‘cifar10-dataset/data_batch_1‘)
data2?=?unpickle(‘cifar10-dataset/data_batch_2‘)
data3?=?unpickle(‘cifar10-dataset/data_bat
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5615??2016-12-28?10:43??cnn-tensorflow-cifar10\cnn-TensorFlow-cifar10.py
?????文件??????73098??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.3218.png
?????文件??????67745??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.3329.png
?????文件??????65355??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.3654.png
?????文件??????66975??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.4215.png
?????文件??????81084??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.5814.png
?????文件??????72932??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.5838.png
?????文件??????71373??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.5902.png
?????文件??????76310??2016-12-28?10:44??cnn-tensorflow-cifar10\cnn-tf-cifar10-0.5956.png
????..AD...?????????0??2016-12-28?10:49??cnn-tensorflow-cifar10
-----------?---------??----------?-----??----
???????????????580487????????????????????10
- 上一篇:教你如何修改加密存檔
- 下一篇:安裝 pywifi 模塊所需要的文件
評論
共有 條評論