Build Deep Neural Networks
Build networks from scratch using MATLAB® code or interactively using the Deep Network Designer app. Use built-in layers to construct networks for tasks such as classification and regression. To see a list of built-in layers, see List of Deep Learning Layers. You can then analyze your network to understand the network architecture and check for problems before training.
If the built-in layers do not provide the layer that you need for your task, then you can define your own custom deep learning layer. You can specify a custom loss function using a custom output layers and define custom layers with or without learnable parameters. After defining a custom layer, you can check that the layer is valid, GPU compatible, and outputs correctly defined gradients.
For networks that cannot be created using layer graphs, you can define a custom network as a function. For an example showing how to train a deep learning model defined as a function, see Train Network Using Model Function.
|Deep Network Designer||Design, visualize, and train deep learning networks|
|Image input layer|
|3-D image input layer|
|Sequence input layer|
|Feature input layer|
Convolution and Fully Connected Layers
|2-D convolutional layer|
|3-D convolutional layer|
|2-D grouped convolutional layer|
|Transposed 2-D convolution layer|
|Transposed 3-D convolution layer|
|Fully connected layer|
|Long short-term memory (LSTM) layer for recurrent neural network (RNN)|
|Bidirectional long short-term memory (BiLSTM) layer for recurrent neural network (RNN)|
|Gated recurrent unit (GRU) layer for recurrent neural network (RNN)|
|Long short-term memory (LSTM) projected layer for recurrent neural network (RNN)|
|Rectified Linear Unit (ReLU) layer|
|Leaky Rectified Linear Unit (ReLU) layer|
|Clipped Rectified Linear Unit (ReLU) layer|
|Exponential linear unit (ELU) layer|
|Hyperbolic tangent (tanh) layer|
|Gaussian error linear unit (GELU) layer|
|Batch normalization layer|
|Group normalization layer|
|Instance normalization layer|
|Layer normalization layer|
|Channel-wise local response normalization layer|
|2-D crop layer|
|3-D crop layer|
|Sequence folding layer|
|Sequence unfolding layer|
Pooling and Unpooling Layers
|Average pooling layer|
|3-D average pooling layer|
|2-D global average pooling layer|
|3-D global average pooling layer|
|Global max pooling layer|
|3-D global max pooling layer|
|Max pooling layer|
|3-D max pooling layer|
|Max unpooling layer|
|Depth concatenation layer|
|Classification output layer|
|Regression output layer|
|Graph of network layers for deep learning|
|Plot neural network architecture|
|Add layers to layer graph or network|
|Remove layers from layer graph or network|
|Replace layer in layer graph or network|
|Connect layers in layer graph or network|
|Disconnect layers in layer graph or network|
|Directed acyclic graph (DAG) network for deep learning|
|Create 2-D residual network|
|Create 3-D residual network|
|Check equality of deep learning layer graphs or networks|
|Check equality of deep learning layer graphs or networks ignoring
|Analyze deep learning network architecture|
|Reset state parameters of neural network|
|Deep learning network for custom training loops|
|Add input layer to network|
|Print network summary|
|Initialize learnable and state parameters of a
|Deep learning network data layout for learnable parameter initialization|
|Check validity of custom or function layer|
|Set L2 regularization factor of layer learnable parameter|
|Get L2 regularization factor of layer learnable parameter|
|Set learn rate factor of layer learnable parameter|
|Get learn rate factor of layer learnable parameter|
- Long Short-Term Memory Neural Networks
Learn about long short-term memory (LSTM) neural networks.
- Create Simple Deep Learning Neural Network for Classification
This example shows how to create and train a simple convolutional neural network for deep learning classification.
- List of Deep Learning Layers
Discover all the deep learning layers in MATLAB.
- Specify Layers of Convolutional Neural Network
Learn about the layers of a convolutional neural network (ConvNet), and the order they appear in a ConvNet.
- Build Networks with Deep Network Designer
Interactively build and edit deep learning networks in Deep Network Designer.
- Example Deep Learning Networks Architectures
This example shows how to define simple deep learning neural networks for classification and regression tasks.
- Generate MATLAB Code from Deep Network Designer
Generate MATLAB code to recreate designing and training a network in Deep Network Designer.
- Define Custom Deep Learning Layers
Learn how to define custom deep learning layers.
- Define Custom Deep Learning Intermediate Layers
Learn how to define custom deep learning intermediate layers.
- Define Custom Deep Learning Output Layers
Learn how to define custom deep learning output layers.
- Import Custom Layer into Deep Network Designer
This example shows how to import a custom classification output layer with the sum of squares error (SSE) loss and add it to a pretrained network in Deep Network Designer.
- Deep Learning Network Composition
Define custom layers containing layer graphs.
- Define Nested Deep Learning Layer
This example shows how to define a nested deep learning layer.
- Check Custom Layer Validity
Learn how to check the validity of custom deep learning layers.
- View Autogenerated Custom Layers Using Deep Network Designer
This example shows how to import a pretrained TensorFlow™ network and view the autogenerated layers in Deep Network Designer.