Main Content

softmaxLayer

Softmax layer

Description

A softmax layer applies a softmax function to the input.

Creation

Description

layer= softmaxLayercreates a softmax layer.

example

layer= softmaxLayer('Name',Name)创建一个软磁层并设置可选的Nameproperty using a name-value pair. For example,softmaxLayer('Name','sm1')creates a softmax layer with the name'sm1'. Enclose the property name in single quotes.

Properties

expand all

图层名称,指定为字符向量或字符串标量。为了Layerarray input, thetrainNetwork,汇编工作,layerGraph, anddlnetworkfunctions automatically assign names to layers with name''.

Data Types:char|string

This property is read-only.

该层的输入数量。该层仅接受单个输入。

Data Types:double

This property is read-only.

Input names of the layer. This layer accepts a single input only.

Data Types:cell

This property is read-only.

Number of outputs of the layer. This layer has a single output only.

Data Types:double

This property is read-only.

层的输出名称。该层仅具有单个输出。

Data Types:cell

Examples

collapse all

Create a softmax layer with the name 'SM1'.

layer = softmaxlayer('Name','sm1')
layer = SoftmaxLayer with properties: Name: 'sm1'

Layerarray.

layers = [...imageInputLayer([28 28 1]) convolution2dLayer(5,20) reluLayer maxPooling2dLayer(2,'Stride',2) fullyConnectedLayer(10) softmaxLayer classificationLayer]
layers = 7x1 Layer array with layers: 1 '' Image Input 28x28x1 images with 'zerocenter' normalization 2 '' Convolution 20 5x5 convolutions with stride [1 1] and padding [0 0 0 0] 3 '' ReLU ReLU 4 '' Max Pooling 2x2 max pooling with stride [2 2] and padding [0 0 0 0] 5 '' Fully Connected 10 fully connected layer 6 '' Softmax softmax 7 '' Classification Output crossentropyex

More About

expand all

参考

[1]Bishop, C. M.Pattern Recognition and Machine Learning. Springer, New York, NY, 2006.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
使用GPU CODER™为NVIDIA®GPU生成CUDA®代码。

Version History

Introduced in R2016a