Main Content

sigmoidLayer

Sigmoid layer

Description

A sigmoid layer applies a sigmoid function to the input such that the output is bounded in the interval (0,1).

Tip

To use the sigmoid layer for binary or multilabel classification problems, create a custom binary cross-entropy loss output layer or use a custom training loop.

Creation

Description

layer = sigmoidLayer creates a sigmoid layer.

example

layer = sigmoidLayer('Name',Name) creates a sigmoid layer and sets the optional Name property using a name-value pair argument. For example, sigmoidLayer('Name','sig1') creates a sigmoid layer with the name 'sig1'. Enclose the property name in single quotes.

Properties

expand all

Layer name, specified as a character vector or a string scalar. To include a layer in a layer graph, you must specify a nonempty unique layer name. If you train a series network with the layer and Name is set to '', then the software automatically assigns a name to the layer at training time.

Data Types: char | string

Number of inputs of the layer. This layer accepts a single input only.

Data Types: double

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

Data Types: cell

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

Data Types: double

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

Data Types: cell

Examples

collapse all

Create a sigmoid layer with the name 'sig1'.

layer = sigmoidLayer('Name', 'sig1')
layer = 
  SigmoidLayer with properties:

    Name: 'sig1'

  Show all properties

More About

expand all

Extended Capabilities

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

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Introduced in R2020b