stdlib_specialfunctions Module



Interfaces

public interface dlegendre

First derivative Legendre polynomial

  • private pure elemental module function dlegendre_fp64(n, x) result(dleg)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: n
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

public interface elu

exponential linear unit function

  • private elemental module function elu_dp(x, a) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x
    real(kind=dp), intent(in) :: a

    Return Value real(kind=dp)

  • private elemental module function elu_sp(x, a) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x
    real(kind=sp), intent(in) :: a

    Return Value real(kind=sp)

public interface elu_grad

gradient of the exponential linear unit function

  • private elemental module function elu_grad_dp(x, a) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x
    real(kind=dp), intent(in) :: a

    Return Value real(kind=dp)

  • private elemental module function elu_grad_sp(x, a) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x
    real(kind=sp), intent(in) :: a

    Return Value real(kind=sp)

public interface fast_erf

Fast approximation of the erf function

  • private elemental module function fast_erf_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function fast_erf_sp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface fast_tanh

Fast approximation of the tanh function

  • private elemental module function fast_tanh_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function fast_tanh_sp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface fast_tanh_grad

gradient of the hyperbolic tangent function

  • private elemental module function fast_tanh_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function fast_tanh_grad_sp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gaussian

gaussian function

  • private elemental module function gaussian_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gaussian_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gaussian_grad

gradient of the gaussian function

  • private elemental module function gaussian_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gaussian_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gelu

Gaussian error linear unit function

  • private elemental module function gelu_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gelu_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gelu_approx

Approximated gaussian error linear unit function

  • private elemental module function gelu_approx_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gelu_approx_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gelu_approx_grad

Gradient of the approximated gaussian error linear unit function

  • private elemental module function gelu_approx_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gelu_approx_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface gelu_grad

Gradient of the gaussian error linear unit function

  • private elemental module function gelu_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function gelu_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface leaky_relu

leaky Rectified linear unit function

  • private elemental module function leaky_relu_dp(x, a) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x
    real(kind=dp), intent(in) :: a

    Return Value real(kind=dp)

  • private elemental module function leaky_relu_sp(x, a) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x
    real(kind=sp), intent(in) :: a

    Return Value real(kind=sp)

public interface leaky_relu_grad

Gradient of the leaky Rectified linear unit function

  • private elemental module function leaky_relu_grad_dp(x, a) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x
    real(kind=dp), intent(in) :: a

    Return Value real(kind=dp)

  • private elemental module function leaky_relu_grad_sp(x, a) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x
    real(kind=sp), intent(in) :: a

    Return Value real(kind=sp)

public interface legendre

Legendre polynomial

  • private pure elemental module function legendre_fp64(n, x) result(leg)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: n
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

public interface logsoftmax

softmax function. Available for ranks 1 to 4

  • private pure module function logsoftmax_r1_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:)

    Return Value real(kind=dp), (size(x))

  • private pure module function logsoftmax_r1_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:)

    Return Value real(kind=sp), (size(x))

  • private pure module function logsoftmax_r2_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2))

  • private pure module function logsoftmax_r2_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2))

  • private pure module function logsoftmax_r3_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2),size(x,3))

  • private pure module function logsoftmax_r3_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2),size(x,3))

public interface relu

Rectified linear unit function

  • private elemental module function relu_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function relu_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface relu_grad

Gradient rectified linear unit function

  • private elemental module function relu_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function relu_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface selu

Scaled Exponential Linear Unit

  • private elemental module function selu_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function selu_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface selu_grad

Scaled Exponential Linear Unit

  • private elemental module function selu_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function selu_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface sigmoid

Sigmoid function

  • private elemental module function sigmoid_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function sigmoid_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface sigmoid_grad

Gradient of the sigmoid function

  • private elemental module function sigmoid_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function sigmoid_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface silu

Sigmoid Linear Unit function

  • private elemental module function silu_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function silu_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface silu_grad

Gradient of the Sigmoid Linear Unit function

  • private elemental module function silu_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function silu_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface softmax

softmax function. Available for ranks 1 to 4

  • private pure module function softmax_r1_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:)

    Return Value real(kind=dp), (size(x))

  • private pure module function softmax_r1_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:)

    Return Value real(kind=sp), (size(x))

  • private pure module function softmax_r2_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2))

  • private pure module function softmax_r2_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2))

  • private pure module function softmax_r3_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2),size(x,3))

  • private pure module function softmax_r3_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2),size(x,3))

public interface softmax_grad

Gradient of the softmax function. Available for ranks 1 to 4

  • private pure module function softmax_grad_r1_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:)

    Return Value real(kind=dp), (size(x))

  • private pure module function softmax_grad_r1_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:)

    Return Value real(kind=sp), (size(x))

  • private pure module function softmax_grad_r2_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2))

  • private pure module function softmax_grad_r2_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2))

  • private pure module function softmax_grad_r3_dp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=dp), (size(x,1),size(x,2),size(x,3))

  • private pure module function softmax_grad_r3_sp(x, dim) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x(:,:,:)
    integer, intent(in), optional :: dim

    Return Value real(kind=sp), (size(x,1),size(x,2),size(x,3))

public interface softplus

softplus function

  • private elemental module function softplus_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function softplus_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface softplus_grad

Gradient of the softplus function

  • private elemental module function softplus_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function softplus_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface step

Step function

  • private elemental module function step_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function step_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)

public interface step_grad

Gradient of the step function

  • private elemental module function step_grad_dp(x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: x

    Return Value real(kind=dp)

  • private elemental module function step_grad_sp(x) result(y)

    (Specification)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: x

    Return Value real(kind=sp)