Skip to contents

Each relation gets its own weight matrix and its own normalisation constant, the paper's default being the per-relation neighbour count. A relation with no neighbours for a node contributes nothing rather than dividing by zero.

Usage

Kgnn(A_r, X, W_r, W0 = NULL)

Arguments

A_r

List of per-relation square adjacency matrices.

X

Node feature matrix, one row per node.

W_r

List of per-relation weight matrices.

W0

Optional self-loop weight matrix; identity by default.

Value

List with estimate, H, n, relations, method.

Details

Formula: h_i' = relu(sum_r sum_{j in N_i^r} W_r h_j / |N_i^r| + W_0 h_i).

References

Schlichtkrull, Kipf, Bloem, van den Berg, Titov and Welling (2018), Modeling relational data with graph convolutional networks, ESWC 2018, eq. (2). arXiv:1703.06103

Examples

Kgnn(A_r = c(1, 2, 3, 4, 5, 6, 7, 8), X = 5L, W_r = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 185
#> 
#> $H
#>      [,1]
#> [1,]  185
#> 
#> $n
#> [1] 1
#> 
#> $relations
#> [1] 8
#> 
#> $method
#> [1] "h' = relu(sum_r sum_j W_r h_j / |N_i^r| + W_0 h_i), Schlichtkrull et al. (2018) eq. (2)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"