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. For Layer array input, the trainNetwork, assembleNetwork, layerGraph, and dlnetwork functions automatically assign names to layers with Name set to ''.

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 a sigmoid layer with the name 'sig1'.

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

    Name: 'sig1'

   Learnable Parameters
    No properties.

   State Parameters
    No properties.

  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