- Deep Learning with R for Beginners
- Mark Hodnett Joshua F. Wiley Yuxi (Hayden) Liu Pablo Maldonado
- 458字
- 2021-06-24 14:30:44
Deep learning layers
In the earlier code snippets, we saw some layers for a deep learning model, including mx.symbol.FullyConnected, mx.symbol.Activation, and mx.symbol.Dropout. Layers are how models are constructed; they are computational transformations of data. For example, mx.symbol.FullyConnected is the first type of layer operation we matrix operation we introduced in Chapter 1, Getting Started with Deep Learning. It is fully connected because all input values are connected to all nodes in the layer. In other deep learning libraries, such as Keras, it is called a dense layer.
The mx.symbol.Activation layer performs an activation function on the output of the previous layer. The mx.symbol.Dropout layer performs dropout on the output from the previous layer. Other common layer types in MXNet are:
- mxnet.symbol.Convolution: Performs a convolutional operation that matches patterns across the data. It is mostly used in computer vision tasks, which we will see in Chapter 5, Image Classification Using Convolutional Neural Networks. They can also be used for Natural Language Processing, which we will see in Chapter 6, Natural Language Processing Using Deep Learning.
- mx.symbol.Pooling: Performs pooling on the output from the previous layer. Pooling reduces the number of elements by taking the average, or max value, from sections of the input. These are commonly used with convolutional layers.
- mx.symbol.BatchNorm: Used to normalize the weights from the previous layer. This is done for the same reason you normalize input data before model-building: it helps the model to train better. It also prevents vanishing and exploding gradients where gradients get very, very small or very, very large during training. This can cause the model to fail to converge, that is, training will fail.
- mx.symbol.SoftmaxOutput: Calculates a softmax result from the output from the previous layer.
There are recognized patterns for using these layers, for example, an activation layer normally follows a fully-connected layer. A dropout layer is usually applied after the activation function, but can be between the fully connected layer and the activation function. Convolutional layers and pooling layers are often used together in image tasks in that order. At this stage, there is no need to try to memorize when to use these layers; you will encounter plenty of examples in the rest of this book!
- 數(shù)據(jù)庫基礎(chǔ)教程(SQL Server平臺)
- Mastering Ninject for Dependency Injection
- SQL Server 2012數(shù)據(jù)庫技術(shù)與應(yīng)用(微課版)
- PySpark大數(shù)據(jù)分析與應(yīng)用
- 云計(jì)算與大數(shù)據(jù)應(yīng)用
- 醫(yī)療大數(shù)據(jù)挖掘與可視化
- 數(shù)據(jù)化網(wǎng)站運(yùn)營深度剖析
- Learn Unity ML-Agents:Fundamentals of Unity Machine Learning
- 智能數(shù)據(jù)時代:企業(yè)大數(shù)據(jù)戰(zhàn)略與實(shí)戰(zhàn)
- 金融商業(yè)算法建模:基于Python和SAS
- AI時代的數(shù)據(jù)價值創(chuàng)造:從數(shù)據(jù)底座到大模型應(yīng)用落地
- Google Cloud Platform for Developers
- 菜鳥學(xué)SPSS數(shù)據(jù)分析
- 算力芯片:高性能CPU/GPU/NPU微架構(gòu)分析
- 數(shù)據(jù)庫高效優(yōu)化:架構(gòu)、規(guī)范與SQL技巧