Apply sigmoid activation
The sigmoid activation operation applies the sigmoid function to the input data.
This operation is equivalent to
sigmoid function to set all values in the
input data to a value between
Create the input data as a single observation of random values with a height and width of seven and 32 channels.
height = 7; width = 7; channels = 32; observations = 1; X = randn(height,width,channels,observations); dlX = dlarray(X,'SSCB');
Compute the sigmoid activation.
dlY = sigmoid(dlX);
All values in
dlY now range between
dlX— Input data
Input data, specified as a
dlarray with or without dimension
dlY— Sigmoid activations
Sigmoid activations, returned as a
dlarray. All values in
dlY are between
dlY has the same underlying data type as the input
If the input data
dlX is a formatted
dlY has the same dimension labels as
dlX. If the
input data is not a formatted
dlY is an
dlarray with the same dimension order as the input data.
Usage notes and limitations:
When the input argument
dlX is a
underlying data of type
gpuArray, this function runs on the
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).