Restricting the relation matrix to its diagonal drops the parameter
count from d^2 to d and makes the score a three-way inner product. The
cost is the symmetry it cannot escape:
score(h, r, t) = score(t, r, h) always, so an antisymmetric
relation is unrepresentable. That is what ComplEx was written to fix.
Examples
triples <- matrix(c(1L, 1L, 2L, 2L, 1L, 3L, 3L, 2L, 1L), ncol = 3, byrow = TRUE)
DistM(triples, dim = 4)
#> $estimate
#> [1] -0.2214821
#>
#> $scores
#> [1] 0.6530551 -0.4343638 -0.8831374
#>
#> $symmetric_gap
#> [1] 1.110223e-16
#>
#> $m
#> [1] 3
#>
#> $dim
#> [1] 4
#>
#> $method
#> [1] "DistMult triple score"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
