Skip to content

sphere_patch_based_geometric_expansion

Bases: geometric_expansion

The sphere patch based geometric expansion function.

It performs the data expansion based on sphere geometric patch shapes and provided expansion metric. This class inherits from the geometric_expansion class, and only redefines the initialization method to declare the patch shape and size.

...

Attributes:

Name Type Description
name str, default = 'sphere_patch_based_geometric_expansion'

Name of the expansion function.

p_r int

Radius of the sphere patch shape.

Methods:

Name Description
__init__

It performs the initialization of the expansion function based on the provided sphere patch shapes.

Source code in tinybig/expansion/geometric_expansion.py
class sphere_patch_based_geometric_expansion(geometric_expansion):
    """
        The sphere patch based geometric expansion function.

        It performs the data expansion based on sphere geometric patch shapes and provided expansion metric.
        This class inherits from the geometric_expansion class, and only redefines the initialization method
        to declare the patch shape and size.

        ...

        Attributes
        ----------
        name: str, default = 'sphere_patch_based_geometric_expansion'
            Name of the expansion function.
        p_r: int
            Radius of the sphere patch shape.

        Methods
        ----------
        __init__
            It performs the initialization of the expansion function based on the provided sphere patch shapes.
    """
    def __init__(
        self,
        p_r: int,
        name: str = 'sphere_patch_based_geometric_expansion',
        *args, **kwargs
    ):
        """
            The initialization method of the sphere patch based geometric expansion function.

            It initializes the sphere expansion function based on the provided sphere patch shape
            of the data segments to be compressed in the provided grid structure.

            Parameters
            ----------
            name: str, default = 'sphere_patch_based_geometric_expansion'
                Name of the expansion function.
            p_r: int
                Radius of the sphere shape.

            Returns
            ----------
            transformation
                The sphere geometric expansion function.
        """
        patch = sphere(p_r=p_r)
        super().__init__(name=name, patch=patch, *args, **kwargs)

__init__(p_r, name='sphere_patch_based_geometric_expansion', *args, **kwargs)

The initialization method of the sphere patch based geometric expansion function.

It initializes the sphere expansion function based on the provided sphere patch shape of the data segments to be compressed in the provided grid structure.

Parameters:

Name Type Description Default
name str

Name of the expansion function.

'sphere_patch_based_geometric_expansion'
p_r int

Radius of the sphere shape.

required

Returns:

Type Description
transformation

The sphere geometric expansion function.

Source code in tinybig/expansion/geometric_expansion.py
def __init__(
    self,
    p_r: int,
    name: str = 'sphere_patch_based_geometric_expansion',
    *args, **kwargs
):
    """
        The initialization method of the sphere patch based geometric expansion function.

        It initializes the sphere expansion function based on the provided sphere patch shape
        of the data segments to be compressed in the provided grid structure.

        Parameters
        ----------
        name: str, default = 'sphere_patch_based_geometric_expansion'
            Name of the expansion function.
        p_r: int
            Radius of the sphere shape.

        Returns
        ----------
        transformation
            The sphere geometric expansion function.
    """
    patch = sphere(p_r=p_r)
    super().__init__(name=name, patch=patch, *args, **kwargs)