local2global.utils.Patch

class Patch[source]

Bases: object

Class for patch embedding

__init__(nodes, coordinates)[source]

Initialise a patch from a list of nodes and corresponding coordinates

Parameters
  • nodes – Iterable of integer node indeces for patch

  • coordinates – Array-like of node coordinates of shape (len(nodes), dim)

Methods

__init__

Initialise a patch from a list of nodes and corresponding coordinates

get_coordinate

get coordinate for a single node

get_coordinates

get coordinates for a list of nodes

Attributes

coordinates

patch embedding coordinates

index

mapping of node index to patch coordinate index

shape

shape of patch coordinates

get_coordinates(nodes)[source]

get coordinates for a list of nodes

Parameters

nodes – Iterable of node indeces

get_coordinate(node)[source]

get coordinate for a single node

Parameters

node – Integer node index