AnchorSearcher

class AnchorSearcher[source]

Bases: abc.ABC

A method for finding the closest anchors.

Methods Summary

__call__(edge_index, anchors, k)

Find the \(k\) closest anchor nodes for each entity.

extra_repr()

Extra components for __repr__.

Methods Documentation

abstract __call__(edge_index, anchors, k)[source]

Find the \(k\) closest anchor nodes for each entity.

Parameters
  • edge_index (ndarray) – shape: (2, m) the edge index

  • anchors (ndarray) – shape: (a,) the selected anchor entity Ids

  • k (int) – the number of closest anchors to return

Return type

ndarray

Returns

shape: (n, k), -1 <= res < a the Ids of the closest anchors

extra_repr()[source]

Extra components for __repr__.

Return type

Iterable[str]