Skip to content

cuboid_max_based_geometric_compression

Bases: cuboid_patch_based_geometric_compression

The cuboid patch and max metric based geometric compression function.

It performs the data compression based on cuboid geometric patch shapes and provided max metric. This class inherits from the cuboid_patch_based_geometric_compression class, and only redefines the initialization method.

...

Attributes:

Name Type Description
name str, default = 'cuboid_max_based_geometric_compression'

Name of the compression function.

Methods:

Name Description
__init__

It performs the initialization of the cuboid compression function based on the max metric.

Source code in tinybig/compression/geometric_compression.py
class cuboid_max_based_geometric_compression(cuboid_patch_based_geometric_compression):
    """
        The cuboid patch and max metric based geometric compression function.

        It performs the data compression based on cuboid geometric patch shapes and provided max metric.
        This class inherits from the cuboid_patch_based_geometric_compression class, and only redefines the initialization method.

        ...

        Attributes
        ----------
        name: str, default = 'cuboid_max_based_geometric_compression'
            Name of the compression function.

        Methods
        ----------
        __init__
            It performs the initialization of the cuboid compression function based on the max metric.
    """
    def __init__(self, name: str = 'cuboid_max_based_geometric_compression', metric: Callable[[torch.Tensor], torch.Tensor] = None, *args, **kwargs):
        """
            The initialization method of the cuboid patch and max metric based geometric compression function.

            It initializes the cuboid compression function with the max compression metric.

            Parameters
            ----------
            name: str, default = 'cuboid_max_based_geometric_compression'
                Name of the cuboid max compression function.

            Returns
            ----------
            transformation
                The cuboid max geometric compression function.
        """
        super().__init__(name=name, metric=batch_max, *args, **kwargs)

__init__(name='cuboid_max_based_geometric_compression', metric=None, *args, **kwargs)

The initialization method of the cuboid patch and max metric based geometric compression function.

It initializes the cuboid compression function with the max compression metric.

Parameters:

Name Type Description Default
name str

Name of the cuboid max compression function.

'cuboid_max_based_geometric_compression'

Returns:

Type Description
transformation

The cuboid max geometric compression function.

Source code in tinybig/compression/geometric_compression.py
def __init__(self, name: str = 'cuboid_max_based_geometric_compression', metric: Callable[[torch.Tensor], torch.Tensor] = None, *args, **kwargs):
    """
        The initialization method of the cuboid patch and max metric based geometric compression function.

        It initializes the cuboid compression function with the max compression metric.

        Parameters
        ----------
        name: str, default = 'cuboid_max_based_geometric_compression'
            Name of the cuboid max compression function.

        Returns
        ----------
        transformation
            The cuboid max geometric compression function.
    """
    super().__init__(name=name, metric=batch_max, *args, **kwargs)