Apply sigmoid activation to 1D array
Computes: f = 1/(1+exp(-x))
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sigmoid_actv_type), | intent(in) | :: | this |
Sigmoid activation type |
||
| type(array_type), | intent(in) | :: | val |
Input values |
Activated output values in range [0,1]
function apply_sigmoid(this, val) result(output) !! Apply sigmoid activation to 1D array !! !! Computes: f = 1/(1+exp(-x)) implicit none ! Arguments class(sigmoid_actv_type), intent(in) :: this !! Sigmoid activation type type(array_type), intent(in) :: val !! Input values type(array_type), pointer :: output !! Activated output values in range [0,1] if(this%apply_scaling)then output => sigmoid(val) * this%scale else output => sigmoid(val) end if end function apply_sigmoid