athena__activation_gaussian Module

Module containing implementation of the Gaussian activation function

This module implements the Gaussian (bell curve) activation, which produces maximum activation at the origin.

Mathematical operation:

Derivative:

Properties: Smooth, symmetric, max at Used in Radial Basis Function (RBF) networks Responds strongly to inputs near


Uses


Interfaces

public interface gaussian_actv_type

  • private function initialise(scale, sigma, mu, attributes) result(activation)

    Initialise a Gaussian activation function

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real32), intent(in), optional :: scale

    Optional scale factor for activation output

    real(kind=real32), intent(in), optional :: sigma

    Optional standard deviation parameter

    real(kind=real32), intent(in), optional :: mu

    Optional mean parameter

    type(onnx_attribute_type), intent(in), optional, dimension(:) :: attributes

    Optional array of ONNX attributes

    Return Value type(gaussian_actv_type)

    Gaussian activation type


Derived Types

type, public, extends(base_actv_type) ::  gaussian_actv_type

Type for Gaussian activation function with overloaded procedures

Components

Type Visibility Attributes Name Initial
logical, public :: apply_scaling = .false.

Boolean to apply scaling or not

real(kind=real32), public :: mu

Mean parameter for Gaussian function

character(len=10), public :: name

Name of the activation function

real(kind=real32), public :: scale = 1._real32

Scale of the activation function

real(kind=real32), public :: sigma

Standard deviation parameter for Gaussian function

real(kind=real32), public :: threshold

Threshold of the activation function

Constructor

private function initialise (scale, sigma, mu, attributes)

Initialise a Gaussian activation function

Type-Bound Procedures

procedure, public, pass(this) :: apply => apply_gaussian
procedure, public, pass(this) :: apply_attributes => apply_attributes_gaussian
procedure, public, pass(this) :: export_attributes => export_attributes_gaussian
procedure, public, pass(this) :: print_to_unit => print_to_unit_actv
procedure, public, pass(this) :: reset => reset_gaussian

Functions

public function create_from_onnx_gaussian_activation(attributes) result(activation)

Create Gaussian activation function from ONNX attributes

Arguments

Type IntentOptional Attributes Name
type(onnx_attribute_type), intent(in), dimension(:) :: attributes

Array of ONNX attributes

Return Value class(base_actv_type), allocatable

Instance of activation type

private function apply_gaussian(this, val) result(output)

Apply Gaussian activation to array

Read more…

Arguments

Type IntentOptional Attributes Name
class(gaussian_actv_type), intent(in) :: this

Gaussian activation type containing sigma parameter

type(array_type), intent(in) :: val

Input values

Return Value type(array_type), pointer

Gaussian activated output values

private pure function export_attributes_gaussian(this) result(attributes)

Export Gaussian activation function attributes as ONNX attributes

Arguments

Type IntentOptional Attributes Name
class(gaussian_actv_type), intent(in) :: this

Gaussian activation type

Return Value type(onnx_attribute_type), allocatable, dimension(:)

Array of ONNX attributes

private function initialise(scale, sigma, mu, attributes) result(activation)

Initialise a Gaussian activation function

Arguments

Type IntentOptional Attributes Name
real(kind=real32), intent(in), optional :: scale

Optional scale factor for activation output

real(kind=real32), intent(in), optional :: sigma

Optional standard deviation parameter

real(kind=real32), intent(in), optional :: mu

Optional mean parameter

type(onnx_attribute_type), intent(in), optional, dimension(:) :: attributes

Optional array of ONNX attributes

Return Value type(gaussian_actv_type)

Gaussian activation type


Subroutines

private subroutine apply_attributes_gaussian(this, attributes)

Load ONNX attributes into Gaussian activation function

Arguments

Type IntentOptional Attributes Name
class(gaussian_actv_type), intent(inout) :: this

Gaussian activation type

type(onnx_attribute_type), intent(in), dimension(:) :: attributes

Array of ONNX attributes

private pure subroutine reset_gaussian(this)

Reset Gaussian activation function attributes and variables

Arguments

Type IntentOptional Attributes Name
class(gaussian_actv_type), intent(inout) :: this

Gaussian activation type