athena__diffstruc_extd_submodule_msgpass_duvenaud Submodule

Submodule containing implementations for extended diffstruc array operations


Uses


Functions

function get_partial_duvenaud_propagate_left(this, upstream_grad) result(output)

Gradient of duvenaud_propagate with respect to vertex_features.

Arguments

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

Forward result node containing saved operands

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

Upstream gradient tensor

Return Value type(array_type)

Gradient tensor for left operand

function get_partial_duvenaud_propagate_right(this, upstream_grad) result(output)

Gradient of duvenaud_propagate with respect to edge_features.

Arguments

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

Forward result node containing saved operands

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

Upstream gradient tensor

Return Value type(array_type)

Gradient tensor for right operand

function get_partial_duvenaud_update(this, upstream_grad) result(output)

Gradient of duvenaud_update with respect to input features.

Arguments

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

Forward result node containing saved operands

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

Upstream gradient tensor

Return Value type(array_type)

Gradient tensor for right operand (input features)

function get_partial_duvenaud_update_weight(this, upstream_grad) result(output)

Gradient of duvenaud_update with respect to packed weights.

Arguments

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

Forward result node containing saved operands

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

Upstream gradient tensor

Return Value type(array_type)

Gradient tensor for left operand (weights)


Subroutines

pure subroutine get_partial_duvenaud_propagate_left_val(this, upstream_grad, output)

In-place value gradient for duvenaud_propagate left operand.

Arguments

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

Forward result node containing saved operands

real(kind=real32), intent(in), dimension(:,:) :: upstream_grad

Upstream gradient values

real(kind=real32), intent(out), dimension(:,:) :: output

Output gradient values for left operand

pure subroutine get_partial_duvenaud_propagate_right_val(this, upstream_grad, output)

In-place value gradient for duvenaud_propagate right operand.

Arguments

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

Forward result node containing saved operands

real(kind=real32), intent(in), dimension(:,:) :: upstream_grad

Upstream gradient values

real(kind=real32), intent(out), dimension(:,:) :: output

Output gradient values for right operand

pure subroutine get_partial_duvenaud_update_val(this, upstream_grad, output)

In-place value gradient for duvenaud_update input features.

Arguments

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

Forward result node containing saved operands

real(kind=real32), intent(in), dimension(:,:) :: upstream_grad

Upstream gradient values

real(kind=real32), intent(out), dimension(:,:) :: output

Output gradient values for input features

pure subroutine get_partial_duvenaud_update_weight_val(this, upstream_grad, output)

In-place value gradient for duvenaud_update packed weights.

Arguments

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

Forward result node containing saved operands

real(kind=real32), intent(in), dimension(:,:) :: upstream_grad

Upstream gradient values

real(kind=real32), intent(out), dimension(:,:) :: output

Output gradient values for packed weights


Module Functions

module function duvenaud_propagate(vertex_features, edge_features, adj_ia, adj_ja) result(c)

Propagate values from one autodiff array to another

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(in), target :: vertex_features

Vertex and edge feature tensors

class(array_type), intent(in), target :: edge_features

Vertex and edge feature tensors

integer, intent(in), dimension(:) :: adj_ia

CSR row pointers

integer, intent(in), dimension(:,:) :: adj_ja

CSR neighbour and edge lookup indices

Return Value type(array_type), pointer

Propagated concatenated feature tensor

module function duvenaud_update(a, weight, adj_ia, min_degree, max_degree) result(c)

Update the message passing layer

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(in), target :: a

Aggregated neighbour features

class(array_type), intent(in), target :: weight

Packed degree-conditioned weight tensor

integer, intent(in), dimension(:) :: adj_ia

CSR row pointers

integer, intent(in) :: min_degree

Minimum and maximum degree buckets

integer, intent(in) :: max_degree

Minimum and maximum degree buckets

Return Value type(array_type), pointer

Degree-conditioned updated feature tensor