Main Content

rpnSoftmaxLayer

Softmax layer for region proposal network (RPN)

Since R2018b

Description

A region proposal network (RPN) softmax layer applies a softmax activation function to the input. Use this layer to create a Faster R-CNN object detection network.

Creation

Description

layer = rpnSoftmaxLayercreates a softmax layer for a Faster R-CNN object detection network.

example

layer = rpnSoftmaxLayer('Name',Name)creates a softmax layer and sets the optionalNameproperty.

Properties

expand all

Layer name, specified as a character vector or a string scalar. ForLayerarray input, thetrainNetwork(Deep Learning Toolbox),assembleNetwork(Deep Learning Toolbox),layerGraph(Deep Learning Toolbox), anddlnetwork(Deep Learning Toolbox)functions automatically assign names to layers with the name''.

Data Types:char|string

This property is read-only.

Number of inputs of the layer. This layer accepts a single input 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.

Output names of the layer. This layer has a single output only.

Data Types:cell

Examples

collapse all

Create an RPN softmax layer with the name'rpn_softmax'.

rpnSoftmax = rpnSoftmaxLayer('Name','rpn_softmax')
rpnSoftmax = RPNSoftmaxLayer with properties: Name: 'rpn_softmax'

Create an RPN classification layer with the name'rpn_cls'.

rpnClassification = rpnClassificationLayer('Name','rpn_cls')
rpnClassification = RPNClassificationLayer with properties: Name: 'rpn_cls'

Add the RPN softmax and RPN classification layers to aLayerarray, to form the classification branch of an RPN.

numAnchors = 3; rpnClassLayers = [ convolution2dLayer(1,numAnchors*2,'Name','conv1x1_box_cls') rpnSoftmax rpnClassification ]
rpnClassLayers = 3x1 Layer array with layers: 1 'conv1x1_box_cls' 2-D Convolution 6 1x1 convolutions with stride [1 1] and padding [0 0 0 0] 2 'rpn_softmax' RPN Softmax rpn softmax 3 'rpn_cls' RPN Classification Output cross-entropy loss with 'object' and 'background' classes

Version History

Introduced in R2018b