Apply leaky ReLU activation to 1D array
Computes: f = max(0.01x, x)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(leaky_relu_actv_type), | intent(in) | :: | this |
Leaky ReLU activation type |
||
| type(array_type), | intent(in) | :: | val |
Input values |
Activated output values
function leaky_relu_activate(this, val) result(output) !! Apply leaky ReLU activation to 1D array !! !! Computes: f = max(0.01x, x) implicit none ! Arguments class(leaky_relu_actv_type), intent(in) :: this !! Leaky ReLU activation type type(array_type), intent(in) :: val !! Input values type(array_type), pointer :: output !! Activated output values ! allocate(output) if(this%apply_scaling)then output => max(val * this%alpha, val) * this%scale else output => max(val * this%alpha, val) end if end function leaky_relu_activate