First derivative of the REctified Linear Unit (RELU) activation function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | x(:) |
pure function relu_prime(x) result(res)
!! First derivative of the REctified Linear Unit (RELU) activation function.
real(rk), intent(in) :: x(:)
real(rk) :: res(size(x))
where (x > 0)
res = 1
elsewhere
res = 0
end where
end function relu_prime