pose_format.torch.representation.distance module

Classes:

DistanceRepresentation(*args, **kwargs)

Represents the Euclidean distance between two points in space.

class pose_format.torch.representation.distance.DistanceRepresentation(*args, **kwargs)[source]

Bases: Module

Represents the Euclidean distance between two points in space.

Methods:

distance(p1s, p2s)

Calculate the Euclidean distance between two sets of points.

forward(p1s, p2s)

Computes Euclidean distance between two sets of points.

Attributes:

training

distance(p1s, p2s)[source]

Calculate the Euclidean distance between two sets of points.

Parameters:
  • p1s (MaskedTensor) – Tensor representing the first set of points.

  • p2s (MaskedTensor) – Tensor representing the second set of points.

Returns:

Tensor representing the calculated distances.

Return type:

MaskedTensor

forward(p1s, p2s)[source]

Computes Euclidean distance between two sets of points.

Parameters:
  • p1s (MaskedTensor) – Tensor representing the first set of points. Shape: (Points, Batch, Len, Dims).

  • p2s (MaskedTensor) – Tensor representing the second set of points. Shape: (Points, Batch, Len, Dims).

Returns:

Tensor representing the Euclidean distances. Shape: (Points, Batch, Len).

Return type:

torch.Tensor

training: bool