Skip to content

cuboid_patch_based_geometric_expansion

Bases: geometric_expansion

The cuboid patch based geometric expansion function.

It performs the data expansion based on cuboid 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 = 'cuboid_patch_based_geometric_expansion'

Name of the expansion function.

p_h int

Height of the cuboid patch along the negative direction.

p_h_prime int, default = None

Height of the cuboid patch along the positive direction.

p_w int

Width of the cuboid patch along the negative direction.

p_w_prime int, default = None

Width of the cuboid patch along the positive direction.

p_d int

Depth of the cuboid patch along the negative direction.

p_d_prime int, default = None

Depth of the cuboid patch along the positive direction.

Methods:

Name Description
__init__

It performs the initialization of the expansion function based on the provided metric and cuboid patch shapes.

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

        It performs the data expansion based on cuboid 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 = 'cuboid_patch_based_geometric_expansion'
            Name of the expansion function.
        p_h: int
            Height of the cuboid patch along the negative direction.
        p_h_prime: int, default = None
            Height of the cuboid patch along the positive direction.
        p_w: int
            Width of the cuboid patch along the negative direction.
        p_w_prime: int, default = None
            Width of the cuboid patch along the positive direction.
        p_d: int
            Depth of the cuboid patch along the negative direction.
        p_d_prime: int, default = None
            Depth of the cuboid patch along the positive direction.

        Methods
        ----------
        __init__
            It performs the initialization of the expansion function based on the provided metric and cuboid patch shapes.
    """
    def __init__(
        self,
        p_h: int, p_w: int, p_d: int,
        p_h_prime: int = None, p_w_prime: int = None, p_d_prime: int = None,
        name: str = 'cuboid_patch_based_geometric_expansion',
        *args, **kwargs
    ):
        """
            The initialization method of the cuboid patch based geometric expansion function.

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

            Parameters
            ----------
            name: str, default = 'cuboid_patch_based_geometric_expansion'
                Name of the expansion function.
            p_h: int
                Height of the cuboid patch along the negative direction.
            p_h_prime: int, default = None
                Height of the cuboid patch along the positive direction.
            p_w: int
                Width of the cuboid patch along the negative direction.
            p_w_prime: int, default = None
                Width of the cuboid patch along the positive direction.
            p_d: int
                Depth of the cuboid patch along the negative direction.
            p_d_prime: int, default = None
                Depth of the cuboid patch along the positive direction.

            Returns
            ----------
            transformation
                The cuboid geometric expansion function.
        """
        patch = cuboid(p_h=p_h, p_w=p_w, p_d=p_d, p_h_prime=p_h_prime, p_w_prime=p_w_prime, p_d_prime=p_d_prime)
        super().__init__(name=name, patch=patch, *args, **kwargs)

__init__(p_h, p_w, p_d, p_h_prime=None, p_w_prime=None, p_d_prime=None, name='cuboid_patch_based_geometric_expansion', *args, **kwargs)

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

It initializes the cuboid expansion function based on the provided cuboid 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.

'cuboid_patch_based_geometric_expansion'
p_h int

Height of the cuboid patch along the negative direction.

required
p_h_prime int

Height of the cuboid patch along the positive direction.

None
p_w int

Width of the cuboid patch along the negative direction.

required
p_w_prime int

Width of the cuboid patch along the positive direction.

None
p_d int

Depth of the cuboid patch along the negative direction.

required
p_d_prime int

Depth of the cuboid patch along the positive direction.

None

Returns:

Type Description
transformation

The cuboid geometric expansion function.

Source code in tinybig/expansion/geometric_expansion.py
def __init__(
    self,
    p_h: int, p_w: int, p_d: int,
    p_h_prime: int = None, p_w_prime: int = None, p_d_prime: int = None,
    name: str = 'cuboid_patch_based_geometric_expansion',
    *args, **kwargs
):
    """
        The initialization method of the cuboid patch based geometric expansion function.

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

        Parameters
        ----------
        name: str, default = 'cuboid_patch_based_geometric_expansion'
            Name of the expansion function.
        p_h: int
            Height of the cuboid patch along the negative direction.
        p_h_prime: int, default = None
            Height of the cuboid patch along the positive direction.
        p_w: int
            Width of the cuboid patch along the negative direction.
        p_w_prime: int, default = None
            Width of the cuboid patch along the positive direction.
        p_d: int
            Depth of the cuboid patch along the negative direction.
        p_d_prime: int, default = None
            Depth of the cuboid patch along the positive direction.

        Returns
        ----------
        transformation
            The cuboid geometric expansion function.
    """
    patch = cuboid(p_h=p_h, p_w=p_w, p_d=p_d, p_h_prime=p_h_prime, p_w_prime=p_w_prime, p_d_prime=p_d_prime)
    super().__init__(name=name, patch=patch, *args, **kwargs)