Sigmoid Layer - Sigmoid layer - Simulink (original) (raw)

Sigmoid layer

Since R2024b

Libraries:
Deep Learning Toolbox / Deep Learning Layers / Activation Layers

Description

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

The exportNetworkToSimulink function generates this block to represent a sigmoidLayer object. Because it applies an element-wise operation, this block supports input data of any format and outputs data that has the same dimensions and format as the input.

Ports

Input

expand all

The matrix to which to apply the sigmoid function.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Output

expand all

The result of applying the sigmoid function on the input matrix.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Parameters

expand all

To edit block parameters interactively, use theProperty Inspector. From the Simulink® Toolstrip, on the Simulation tab, in thePrepare gallery, select Property Inspector.

Data Types

Specify the type of approximation for computing the output.

Approximation Method Data Types Supported When to Use This Method
None (default) Floating point You are processing only floating point data.
CORDIC Floating point (double and single) and fixed point with aBias value of 0 and aSlope value of a power of 2 You are processing fixed point data and want to deploy to FPGA hardware.
Lookup Floating point and fixed point You are processing fixed point data and want to generate C/C++ code.

For more information about the CORDIC approximation method, see cordictanh (Fixed-Point Designer).

Programmatic Use

Block Parameter: ApproximationMethod
Type: character vector
Values: 'none' | 'CORDIC' 'Lookup'
Default: 'none'

Lower value of the output range that the software checks.

The software uses the minimum to perform:

Tips

Output minimum does not saturate or clip the actual output signal. Use the Saturation (Simulink) block instead.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: OutMin
Values: '[]' (default) | scalar in quotes

Upper value of the output range that the software checks.

The software uses the maximum value to perform:

Tips

Output maximum does not saturate or clip the actual output signal. Use the Saturation (Simulink) block instead.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: OutMax
Values: '[]' (default) | scalar in quotes

Choose the data type for the output. The type can be inherited, specified directly, or expressed as a data type object such as Simulink.NumericType. When you select Inherit: Inherit via internal rule, Simulink chooses a data type to balance numerical accuracy, performance, and generated code size, while taking into account the properties of the embedded target hardware.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: OutDataTypeStr
Values: 'Inherit: Inherit via internal rule' (default) |

Select this parameter to prevent the fixed-point tools from overriding theOutput data type you specify on the block. For more information, see Use Lock Output Data Type Setting (Fixed-Point Designer).

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: LockScale
Values: 'off' (default) | 'on'

Specify the rounding mode for fixed-point operations. For more information, seeRounding Modes (Fixed-Point Designer).

Block parameters always round to the nearest representable value. To control the rounding of a block parameter, enter an expression using a MATLAB® rounding function into the mask field.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: RndMeth
Values: 'Floor' (default) | 'Ceiling' 'Convergent' 'Nearest' 'Round' 'Simplest' 'Zero'

Specify whether overflows saturate or wrap.

For example, the maximum value that the signed 8-bit integerint8 can represent is 127. Any block operation result greater than this maximum value causes overflow of the 8-bit integer.

Tips

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: SaturateOnIntegerOverflow
Values: 'off' (default) | 'on'

Execution

Specify the discrete interval between sample time hits or specify another type of sample time, such as continuous (0) or inherited (-1). For more options, see Types of Sample Time (Simulink).

By default, the block inherits its sample time based on the context of the block within the model.

Programmatic Use

To set the block parameter value programmatically, use the set_param (Simulink) function.

Parameter: SampleTime
Data Types: char
Values: '-1' (default) | scalar

Extended Capabilities

Version History

Introduced in R2024b

expand all

The Output data type value options are 'Inherit: Inherit via internal rule' and <data type expression>. Previously, the Output data type value options were 'Inherit: Inherit via internal rule','Inherit: Keep MSB', 'Inherit: Keep LSB', 'Inherit: Inherit via back propagation','Inherit: Same as first input', and <data type expression>.

Block parameters do not depend on the value of Approximation method. Previously, the value of Approximation method had to be 'None' to enable the other block parameters.