1. 程式人生 > >【讀書1】【2017】MATLAB與深度學習——示例:MNIST(1)

【讀書1】【2017】MATLAB與深度學習——示例:MNIST(1)

因此,我們有8000幅MNIST影象用於訓練,2000幅影象用於神經網路的效能驗證。

Therefore, we have 8,000 MNIST images fortraining and 2,000 images for validation of the performance of the neuralnetwork.

正如你目前所知道的,MNIST問題是將28x28畫素影象分類為0 – 9中的10個數字之一。

As you may know well by now, the MNIST problemis caused by the multiclass classification of the 28x28 pixel image into one ofthe ten digit classes of 0-9.

讓我們考慮一個識別MNIST影象的ConvNet。

Let’s consider a ConvNet that recognizesthe MNIST images.

由於輸入是一個28×28畫素的黑白影象,因此我們需要784(=28×28)個輸入節點。

As the input is a 28×28 pixel black-and-white image, weallow 784(=28x28) input nodes.

特徵提取網路包含一個具有20個9×9卷積濾波器的單卷積層。

The feature extraction network contains asingle convolution layer with 20 9×9 convolution filters.

卷積層的輸出通過ReLU函式,然後經過池化層。

The output from the convolution layerpasses through the ReLU function, followed by the pooling layer.

池化層採用2x2子矩陣的平均池化實現。

The pooling layer employs the mean poolingprocess of two by two submatrices.

分類神經網路由單隱藏層和輸出層組成。

The classification neural network consistsof the single hidden layer and output layer.

該隱藏層由100個使用ReLU啟用函式的節點組成。

This hidden layer has 100 nodes that usethe ReLU activation function.

由於我們將輸入影象分為10類,因此輸出層由10個節點構成。

Since we have 10 classes to classify, theoutput layer is constructed with 10 nodes.

輸出節點使用softmax啟用函式。

We use the softmax activation function forthe output nodes.

下表總結了示例神經網路的構成。

The following table summarizes the exampleneural network.
在這裡插入圖片描述

圖6-18為該神經網路的體系結構。

Figure 6-18 shows the architecture of thisneural network.

在這裡插入圖片描述

圖6-18 示例神經網路的體系結構The architecture of thisneural network

雖然該神經網路包含許多層,但只有三層包含需要訓練的權重矩陣;它們分別是方塊中的W1、W5和Wo。

Although it has many layers, only three ofthem contain the weight matrices that require training; they are W1, W5, and Woin the square blocks.

W5和Wo包含分類神經網路的連線權重,而W1是卷積層的權重,用於影象處理的卷積濾波器。

W5 and Wo contain the connection weights ofthe classification neural network, while W1 is the convolution layer’s weight,which is used by the convolution filters for image processing.

池化層與隱藏層之間的輸入節點,即W5左邊的正方形圖示,其作用是將二維影象轉換為一維向量。

The input nodes between the pooling layerand the hidden layer, which are the square nodes left of the W5block, are the transformations of the two-dimensional image into a vector.

由於該層只是純粹的矩陣轉換,不涉及任何運算操作,因此這些節點被表示為正方形。

As this layer does not involve anyoperations, these nodes are denoted as squares.

——本文譯自Phil Kim所著的《Matlab Deep Learning》

更多精彩文章請關注微訊號:在這裡插入圖片描述