1. 程式人生 > >Tensorflow and deep learning without a PhD系列第一部分 數字識別問題

Tensorflow and deep learning without a PhD系列第一部分 數字識別問題

Tensorflow and deep learning without a PhD系列第一部分
原始連結:
https://codelabs.developers.google.com/codelabs/cloud-tensorflow-mnist/#1

試驗目的:
What is a neural network and how to train it - 對神經網路有初步理解,瞭解如何訓練一個神經網路
How to build a basic 1-layer neural network using TensorFlow – 使用tensorflow框架建造一個簡單的一層神經網路
How to add more layers – 學習新增更多的層
Training tips and tricks: overfitting, dropout, learning rate decay… – 訓練中的技巧:過度擬合、丟棄、學習率衰減等
How to troubleshoot deep neural networks – 如何解決深度神經網路中的問題
How to build convolutional networks – 如何建造卷積神經網路

前提條件:
Python 2 or 3 (Python 3 recommended)
TensorFlow
Matplotlib (Python visualisation library)
需要的命令參考下面連結:
https://github.com/GoogleCloudPlatform/tensorflow-without-a-phd/blob/master/tensorflow-mnist-tutorial/INSTALL.txt

先把原始檔通過git下載到本地,進入例子所在目錄後執行:
python mnist_1.0_softmax.py
得到下面的圖形化輸出:
在這裡插入圖片描述

  1. 訓練神經網路
    基本步驟
    Training digits(訓練數字集) => updates to weights and biases(更新權重和偏置) => better recognition (loop)(更好的識別率)
    訓練數字集

    每次輸入100個數字進行訓練,訓練過程中你可以通過觀察字元的背景顏色來區分是否數字被正確識別,白色背景的是正確識別的,紅色背景的是識別有誤的,同時數字左下方帶正確的小數字,右下方帶計輸出來的錯誤小數字。
    There are 50,000 training digits in this dataset. We feed 100 of them into the training loop at each iteration so the system will have seen all the training digits once after 500 iterations. We call this an “epoch”.
    資料集中有50000個待訓練數字,每個訓練迴圈輸入100個數字,我們需要重複500次才能把所有的數字輸入系統中。這個過程稱為一個紀元。

未完待續… …