Skip to content

Polar

Polar(norm: bool = True, max_value: Optional[float] = None, cat: bool = True)

Bases: BaseTransform

Saves the polar coordinates (distance and angle in \([0, 2\pi)\)) of linked nodes of 2D graphs in its edge features.

Parameters:

Name Type Description Default
norm bool

If True, normalizes the distances to \([0, 1]\) and the angles by \(2\pi\). Default: True

True
max_value Optional[float]

If set and norm is True, normalizes the distances with this value instead of the largest one. Default: None

None
cat bool

If False, replaces the existing edge features instead of concatenating. Default: True

True

Example:

from mlx_graphs.transforms import Polar

graph = Polar()(graph)
Source code in mlx_graphs/transforms/point_cloud.py
def __init__(
    self, norm: bool = True, max_value: Optional[float] = None, cat: bool = True
):
    self.norm = norm
    self.max = max_value
    self.cat = cat

from mlx_graphs.transforms import Polar · mlx_graphs/transforms/point_cloud.py