Machine Learning for Economics and Finance in TensorFlow 2 by Isaiah Hull

Machine Learning for Economics and Finance in TensorFlow 2 by Isaiah Hull

Author:Isaiah Hull
Language: eng
Format: epub
ISBN: 9781484263730
Publisher: Apress


A convolutional neural network (CNN) makes use of convolutional layers, which are designed to handle image data. Figure 5-6 demonstrates how such layers work. For simplicity, we’ll assume that we’re working with a 4x4 pixel grayscale image, which is shown in pink in the figure. The convolutional layer will apply filters, such as the one shown in blue, by performing elementwise multiplication of the filter and image segment and then summing the elements of the resulting matrix. In this case, the filter is 2x2 and is first applied to the red segment of the image, yielding the scalar value 0.7. The filter is then moved to the right and applied to the next 2x2 segment of the image, yielding a 0 value. The process is repeated for all 2x2 segments of the image, yielding a 3x3 matrix, which is shown in yellow.

Figure 5-7 demonstrates how convolutional layers fit into a CNN.6 The first layer is an input layer, which accepts color image tensors of shape (64, 64, 3). Next, a convolutional layer with 16 filters is applied. Notice that each filter is applied across the color channel, yielding an output of 64x64x16. In addition to performing the multiplication step illustrated in Figure 5-7, the layer also applies an activation function to each element of the output, which leaves the shape unchanged. Note that the 16 64x64 matrices that resulted from the operations in this layer each are referred to as “feature maps.”

Figure 5-6A 2x2 convolutional filter applied to a 4x4 image



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.