boxe_interaction

boxe_interaction(h_pos, h_bump, rh_base, rh_delta, rh_size, rt_base, rt_delta, rt_size, t_pos, t_bump, tanh_map=True, p=2, power_norm=False)[source]

Evalute the BoxE interaction function from [abboud2020].

Entities are described via position and bump. Relations are described as a pair of boxes, where each box is parametrized as triple (base, delta, size), where # TODO

Note

this interaction relies on Abboud’s point-to-box distance pykeen.utils.point_to_box_distance().

Parameters
  • h_pos (FloatTensor) – shape: (*batch_dims, d) the head entity position

  • h_bump (FloatTensor) – shape: (*batch_dims, d) the head entity bump

  • rh_base (FloatTensor) – shape: (*batch_dims, d) the relation-specific head box base position

  • rh_delta (FloatTensor) – shape: (*batch_dims, d) # the relation-specific head box base shape (normalized to have a volume of 1):

  • rh_size (FloatTensor) – shape: (*batch_dims, 1) the relation-specific head box size (a scalar)

  • rt_base (FloatTensor) – shape: (*batch_dims, d) the relation-specific tail box base position

  • rt_delta (FloatTensor) – shape: (*batch_dims, d) # the relation-specific tail box base shape (normalized to have a volume of 1):

  • rt_size (FloatTensor) – shape: (*batch_dims, d) the relation-specific tail box size

  • t_pos (FloatTensor) – shape: (*batch_dims, d) the tail entity position

  • t_bump (FloatTensor) – shape: (*batch_dims, d) the tail entity bump

  • tanh_map (bool) – whether to apply the tanh mapping

  • p (int) – the order of the norm to apply

  • power_norm (bool) – whether to use the p-th power of the p-norm instead

Return type

FloatTensor

Returns

shape: batch_dims The scores.