Keras Cifar-10

這次來用Keras建立CNN,辨識Cifar-10影像資料 Cifar-10 是32*32 RBG的圖形,裡面包含了10種,像是飛機、狗、貓等等 可以看成是MNIST的困難版 因此在Preprocess的時候做的事情都是一樣的,並進行one hot encoding 其中在convolution選擇兩層,kernal 3*3 ,same padding maxpooling 是2*2的大小,在接上 NN從4096–1024–10(最後輸出) 可以注意一下Keras 和 Tensorflow一些參數表現的不同 這是Cifar-10的圖像 利用pandas建立confusion matrix,來看出是不是混淆了某些類別。 可以看出第三類(cat)和第五類(dog)容易混淆,以及動物類和交通工具類不太容易混淆 兩層CNN準確率:0.732 My Github

2017-07-06 · 1 min · 25 words · KbWen

Kaggle Digit Recognizer

進入 Kaggle的第一個試題 Kaggle digit recognizer 是一個用CSV儲存的 MNIST 問題 因次用CNN來解決這次的問題 Visually, if we omit the “pixel” prefix, the pixels make up the image like this: 000 001 002 003 … 026 027 028 029 030 031 … 054 055 056 057 058 059 … 082 083 | | | | … | | 728 729 730 731 … 754 755 756 757 758 759 … 782 783 The test data set, (test.csv), is the same as the training set, except that it does not contain the “label” column. Your submission file should be in the following format: For each of the 28000 images in the test set, output a single line containing the ImageId and the digit you predict. For example, if you predict that the first image is of a 3, the second image is of a 7, and the third image is of a 8, then your submission file would look like: ...

2017-06-05 · 1 min · 211 words · KbWen

Tensorflow 練習2: CNN

利用CNN 來預測數字(MNIST) 輸入圖形是一個28*28 灰階09的數字 輸出是一個1*10的矩陣,裡面代表的是我們預測09的數字 流程是 輸入–convolution–pooling–convolution–pooling–hidden layer–output 用到[None,xx,xx]和[-1,XX,xx],代表著我們忽略輸入的大小,他會跟隨著輸入改變 max pooling 是表示我們選擇的是那個kernel size裡的最大值 並且也加入dropout 避免overfitting 詳細分析參照 Tensorflow 結果 上圖是沒有dropout下圖是有dropout 就這個例子而言差別不大,但還是看的出來上面的訓練會比測試好 準確率落在97%~99%之間(1000次訓練) (用GradientDescent,其他的應該會更好) 代碼 My GitHub

2017-05-07 · 1 min · 25 words · KbWen