Skip to content

exponential_kernel_interdependence

Bases: numerical_kernel_based_interdependence

A kernel-based interdependence class using the exponential kernel.

Notes

Exponential Kernel:

\[
    \begin{equation}
    \text{kernel}(\mathbf{x}, \mathbf{y} | \gamma) = \exp \left(- \gamma \left\| \mathbf{x} - \mathbf{y} \right\|_1 \right).
    \end{equation}
\]

Attributes:

Name Type Description
kernel Callable

The exponential kernel function.

Methods:

Name Description
__init__

Initializes the exponential kernel interdependence function.

Source code in tinybig/interdependence/numerical_kernel_interdependence.py
class exponential_kernel_interdependence(numerical_kernel_based_interdependence):
    r"""
        A kernel-based interdependence class using the exponential kernel.

        Notes
        ----------
        __Exponential Kernel:__

        $$
            \begin{equation}
            \text{kernel}(\mathbf{x}, \mathbf{y} | \gamma) = \exp \left(- \gamma \left\| \mathbf{x} - \mathbf{y} \right\|_1 \right).
            \end{equation}
        $$

        Attributes
        ----------
        kernel : Callable
            The exponential kernel function.

        Methods
        -------
        __init__(...)
            Initializes the exponential kernel interdependence function.
    """
    def __init__(self, name: str = 'exponential_kernel_interdependence', gamma: float = 1.0, *args, **kwargs):
        """
            Initializes the exponential kernel interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'exponential_kernel_interdependence'.
            gamma : float, optional
                Scale factor of the exponential kernel. Defaults to 1.0.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        exponential_kernel_func = functools.partial(exponential_kernel, gamma=gamma)
        super().__init__(kernel=exponential_kernel_func, name=name, *args, **kwargs)

__init__(name='exponential_kernel_interdependence', gamma=1.0, *args, **kwargs)

Initializes the exponential kernel interdependence function.

Parameters:

Name Type Description Default
name str

Name of the interdependence function. Defaults to 'exponential_kernel_interdependence'.

'exponential_kernel_interdependence'
gamma float

Scale factor of the exponential kernel. Defaults to 1.0.

1.0
*args tuple

Additional positional arguments for the parent class.

()
**kwargs dict

Additional keyword arguments for the parent class.

{}
Source code in tinybig/interdependence/numerical_kernel_interdependence.py
def __init__(self, name: str = 'exponential_kernel_interdependence', gamma: float = 1.0, *args, **kwargs):
    """
        Initializes the exponential kernel interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'exponential_kernel_interdependence'.
        gamma : float, optional
            Scale factor of the exponential kernel. Defaults to 1.0.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    exponential_kernel_func = functools.partial(exponential_kernel, gamma=gamma)
    super().__init__(kernel=exponential_kernel_func, name=name, *args, **kwargs)