One way of down-sampling is using a max pooling, which you create using maxPooling2dLayer. Down-sampling makes it possible to increase the number of filters in deeper convolutional layers without increasing the required amount of computation per layer. Max Pooling Layer Convolutional layers (with activation functions) are sometimes followed by a down-sampling operation that reduces the spatial size of the feature map and removes redundant spatial information. The most common activation function is the rectified linear unit (ReLU). ReLU Layer The batch normalization layer is followed by a nonlinear activation function. Use batchNormalizationLayer to create a batch normalization layer. Use batch normalization layers between convolutional layers and nonlinearities, such as ReLU layers, to speed up neural network training and reduce the sensitivity to neural network initialization. You can also define the stride and learning rates for this layer using name-value pair arguments of convolution2dLayer.īatch Normalization Layer Batch normalization layers normalize the activations and gradients propagating through a neural network, making neural network training an easier optimization problem. For a convolutional layer with a default stride of 1, 'same' padding ensures that the spatial output size is the same as the input size. Use the 'Padding' name-value pair to add padding to the input feature map. This parameter determines the number of feature maps. The second argument is the number of filters, numFilters, which is the number of neurons that connect to the same region of the input. You can specify different sizes for the height and width of the filter. In this example, the number 3 indicates that the filter size is 3-by-3. trainNetwork can also automatically shuffle the data at the beginning of every epoch during training.Ĭonvolutional Layer In the convolutional layer, the first argument is filterSize, which is the height and width of the filters the training function uses while scanning along the images. You do not need to shuffle the data because trainNetwork, by default, shuffles the data at the beginning of training. For a color image, the channel size is 3, corresponding to the RGB values. The digit data consists of grayscale images, so the channel size (color channel) is 1. These numbers correspond to the height, width, and the channel size. Image Input Layer An imageInputLayer is where you specify the image size, which, in this case, is 28-by-28-by-1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |