athena__onnx_creators Module

Module containing ONNX layer creator functions



Functions

public function build_duvenaud_onnx_expanded_gnn(prefix, nodes, num_nodes, inits, num_inits, inputs, num_inputs) result(layer)

Build a Duvenaud layer from an expanded-ONNX cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. "node_2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

type(onnx_tensor_type), intent(in) :: inputs(:)

Parsed ONNX graph input tensors

integer, intent(in) :: num_inputs

Number of valid graph input entries

Return Value class(base_layer_type), allocatable

Constructed Duvenaud layer

public function build_dynamic_lno_onnx_expanded_nop(prefix, nodes, num_nodes, inits, num_inits) result(layer)

Build one dynamic LNO layer from an expanded-ONNX node cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. layer1)

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

Return Value class(base_layer_type), allocatable

Constructed dynamic LNO layer

public function build_fixed_lno_onnx_expanded_nop(prefix, nodes, num_nodes, inits, num_inits) result(layer)

Build one fixed LNO layer from an expanded-ONNX node cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. layer2)

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

Return Value class(base_layer_type), allocatable

Constructed fixed LNO layer

public function build_kipf_onnx_expanded_gnn(prefix, nodes, num_nodes, inits, num_inits, inputs, num_inputs) result(layer)

Build a Kipf GCN layer from an expanded-ONNX cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. "node_2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

type(onnx_tensor_type), intent(in) :: inputs(:)

Parsed ONNX graph input tensors

integer, intent(in) :: num_inputs

Number of valid graph input entries

Return Value class(base_layer_type), allocatable

Constructed Kipf GCN layer

public function build_neural_operator_onnx_expanded_nop(prefix, nodes, num_nodes, inits, num_inits) result(layer)

Build one neural operator layer from an expanded-ONNX node cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. layer3)

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

Return Value class(base_layer_type), allocatable

Constructed neural operator layer

public function build_spectral_filter_onnx_expanded_nop(prefix, nodes, num_nodes, inits, num_inits) result(layer)

Build one spectral filter layer from an expanded-ONNX node cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. layer4)

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

type(onnx_initialiser_type), intent(in) :: inits(:)

Parsed ONNX initialisers

integer, intent(in) :: num_inits

Number of valid initialiser entries

Return Value class(base_layer_type), allocatable

Constructed spectral filter layer

public function classify_duvenaud_onnx_expanded_gnn(prefix, nodes, num_nodes) result(is_duvenaud)

Return true when the expanded-ONNX node cluster for prefix is a Duvenaud message-passing layer.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer prefix (e.g. "node_2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value: true when the cluster matches the Duvenaud pattern

public function classify_dynamic_lno_onnx_expanded_nop(prefix, nodes, num_nodes) result(is_dynamic_lno)

Return true when the expanded-ONNX node cluster for prefix is a dynamic LNO.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Expanded-ONNX layer prefix (e.g. "layer1")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value

public function classify_fixed_lno_onnx_expanded_nop(prefix, nodes, num_nodes) result(is_fixed_lno)

Return true when the expanded-ONNX node cluster for prefix is a fixed LNO.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Expanded-ONNX layer prefix (e.g. "layer2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value

Fixed LNO has MatMul_3 but not the Exp/Exp_1 pair of dynamic LNO

public function classify_kipf_onnx_expanded_gnn(prefix, nodes, num_nodes) result(is_kipf)

Return true when the expanded-ONNX node cluster for prefix is a Kipf GCN layer.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer prefix (e.g. "node_2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value: true when the cluster matches the Kipf GCN pattern

public function classify_neural_operator_onnx_expanded_nop(prefix, nodes, num_nodes) result(is_neural_operator)

Return true when the expanded-ONNX node cluster for prefix is a neural operator.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Expanded-ONNX layer prefix (e.g. "layer3")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value

Neural operator has ReduceMean but not Exp/Exp_1 or MatMul_3

public function classify_spectral_filter_onnx_expanded_nop(prefix, nodes, num_nodes) result(is_spectral_filter)

Return true when the expanded-ONNX node cluster for prefix is a spectral filter.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Expanded-ONNX layer prefix (e.g. "layer4")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value logical

Return value

Spectral filter has Mul but not Exp/Exp_1 or ReduceMean or MatMul_3

public function create_from_onnx_avgpool_layer(node, initialisers, value_info, verbose) result(layer)

Build avgpool layer from attributes and return layer

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: node

ONNX node information

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialiser information

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value info information

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the 2D convolutional layer

public function create_from_onnx_batchnorm_layer(node, initialisers, value_info, verbose) result(layer)

Build batchnorm layer from attributes and return layer

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: node

ONNX node information

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialiser information

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value info information

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the batch normalisation layer

public function create_from_onnx_conv_layer(node, initialisers, value_info, verbose) result(layer)

Build conv layer from attributes and return layer

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: node

ONNX node information

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialiser information

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value info information

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the 2D convolutional layer

public function create_from_onnx_duvenaud_layer(meta_key, meta_value, inits, verbose) result(layer)

Build Duvenaud message-passing layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

GNN metadata key (e.g. "athena_gnn_node_1")

character(len=*), intent(in) :: meta_value

Semicolon-separated GNN metadata value string

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers (valid entries only)

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed Duvenaud message-passing layer

public function create_from_onnx_dynamic_lno_layer(meta_key, meta_value, inits, verbose) result(layer)

Build dynamic LNO layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

NOP metadata key/value pair

character(len=*), intent(in) :: meta_value

NOP metadata key/value pair

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers containing parameter tensors

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed dynamic LNO layer

public function create_from_onnx_fixed_lno_layer(meta_key, meta_value, inits, verbose) result(layer)

Build fixed LNO layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

NOP metadata key/value pair

character(len=*), intent(in) :: meta_value

NOP metadata key/value pair

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers containing parameter tensors

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed fixed LNO layer

public function create_from_onnx_kipf_layer(meta_key, meta_value, inits, verbose) result(layer)

Build Kipf GCN layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

GNN metadata key (e.g. "athena_gnn_node_1")

character(len=*), intent(in) :: meta_value

Semicolon-separated GNN metadata value string

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers (valid entries only)

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed Kipf GCN layer

public function create_from_onnx_maxpool_layer(node, initialisers, value_info, verbose) result(layer)

Build maxpool layer from attributes and return layer

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: node

ONNX node information

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialiser information

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value info information

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the 2D convolutional layer

public function create_from_onnx_neural_operator_layer(meta_key, meta_value, inits, verbose) result(layer)

Build neural_operator layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

NOP metadata key/value pair

character(len=*), intent(in) :: meta_value

NOP metadata key/value pair

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers containing parameter tensors

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed neural operator layer

public function create_from_onnx_orthogonal_attention_layer(meta_key, meta_value, inits, verbose) result(layer)

Build orthogonal attention layer from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

NOP metadata key/value pair

character(len=*), intent(in) :: meta_value

NOP metadata key/value pair

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers containing parameter tensors

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed orthogonal attention layer

public function create_from_onnx_orthogonal_nop_layer(meta_key, meta_value, inits, verbose) result(layer)

Build orthogonal NOP block from ONNX metadata and return layer

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: meta_key

NOP metadata key/value pair

character(len=*), intent(in) :: meta_value

NOP metadata key/value pair

type(onnx_initialiser_type), intent(in), dimension(:) :: inits

ONNX initialisers containing parameter tensors

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Constructed orthogonal NOP layer

public function create_from_onnx_pad_layer(node, initialisers, value_info, verbose) result(layer)

Build pad layer from attributes and return layer

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: node

ONNX node information

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialiser information

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value info information

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the pad layer

private function detect_gnn_expanded_activation(prefix, nodes, num_nodes) result(name)

Detect the activation op used in a GNN layer cluster.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix

Layer node prefix (e.g. "node_2")

type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

Return Value character(len=64)

Detected ATHENA activation name

private function find_gnn_node(nodes, num_nodes, name) result(idx)

Return the index of a node with exact name match, or zero.

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

character(len=*), intent(in) :: name

Exact node name to search for

Return Value integer

Return value: index of the matching node, or zero if not found