Skip to content

tsne_manifold_compression

Bases: manifold_compression

A manifold-based dimensionality reduction class using t-SNE (t-distributed Stochastic Neighbor Embedding).

This class applies the t-SNE algorithm to reduce the dimensionality of input data, maintaining the local structure of the data in the reduced space.

Methods:

Name Description
__init__

Initializes the t-SNE-based dimensionality reduction instance.

Parameters:

Name Type Description Default
D int

Number of dimensions to retain after compression.

required
perplexity float

Perplexity parameter for the t-SNE algorithm, which controls the balance between local and global aspects of the data.

required
name str

Name of the transformation. Defaults to 'tsne_manifold_compression'.

'tsne_manifold_compression'
*args tuple

Additional positional arguments for the parent manifold_compression class.

()
**kwargs dict

Additional keyword arguments for the parent manifold_compression class.

{}
Source code in tinybig/compression/manifold_compression.py
class tsne_manifold_compression(manifold_compression):
    """
        A manifold-based dimensionality reduction class using t-SNE (t-distributed Stochastic Neighbor Embedding).

        This class applies the t-SNE algorithm to reduce the dimensionality of input data, maintaining
        the local structure of the data in the reduced space.

        Methods
        -------
        __init__(D, perplexity, name='tsne_manifold_compression', *args, **kwargs)
            Initializes the t-SNE-based dimensionality reduction instance.

        Parameters
        ----------
        D : int
            Number of dimensions to retain after compression.
        perplexity : float
            Perplexity parameter for the t-SNE algorithm, which controls the balance between local and global
            aspects of the data.
        name : str, optional
            Name of the transformation. Defaults to 'tsne_manifold_compression'.
        *args : tuple
            Additional positional arguments for the parent `manifold_compression` class.
        **kwargs : dict
            Additional keyword arguments for the parent `manifold_compression` class.
    """
    def __init__(self, D: int, perplexity: float, name='tsne_manifold_compression', *args, **kwargs):
        """
            Initializes the t-SNE-based dimensionality reduction instance.

            Parameters
            ----------
            D : int
                Number of dimensions to retain after compression.
            perplexity : float
                Perplexity parameter for the t-SNE algorithm, which controls the balance between local and global
                aspects of the data.
            name : str, optional
                Name of the transformation. Defaults to 'tsne_manifold_compression'.
            *args : tuple
                Additional positional arguments for the parent `manifold_compression` class.
            **kwargs : dict
                Additional keyword arguments for the parent `manifold_compression` class.
        """
        manifold_function = tsne_manifold(n_components=D, perplexity=perplexity)
        super().__init__(D=D, name=name, manifold_function=manifold_function, *args, **kwargs)

__init__(D, perplexity, name='tsne_manifold_compression', *args, **kwargs)

Initializes the t-SNE-based dimensionality reduction instance.

Parameters:

Name Type Description Default
D int

Number of dimensions to retain after compression.

required
perplexity float

Perplexity parameter for the t-SNE algorithm, which controls the balance between local and global aspects of the data.

required
name str

Name of the transformation. Defaults to 'tsne_manifold_compression'.

'tsne_manifold_compression'
*args tuple

Additional positional arguments for the parent manifold_compression class.

()
**kwargs dict

Additional keyword arguments for the parent manifold_compression class.

{}
Source code in tinybig/compression/manifold_compression.py
def __init__(self, D: int, perplexity: float, name='tsne_manifold_compression', *args, **kwargs):
    """
        Initializes the t-SNE-based dimensionality reduction instance.

        Parameters
        ----------
        D : int
            Number of dimensions to retain after compression.
        perplexity : float
            Perplexity parameter for the t-SNE algorithm, which controls the balance between local and global
            aspects of the data.
        name : str, optional
            Name of the transformation. Defaults to 'tsne_manifold_compression'.
        *args : tuple
            Additional positional arguments for the parent `manifold_compression` class.
        **kwargs : dict
            Additional keyword arguments for the parent `manifold_compression` class.
    """
    manifold_function = tsne_manifold(n_components=D, perplexity=perplexity)
    super().__init__(D=D, name=name, manifold_function=manifold_function, *args, **kwargs)