Skip to content

linear_kernel_interdependence

Bases: numerical_kernel_based_interdependence

A kernel-based interdependence class using a linear kernel.

Notes

Linear (Inner-Product) Kernel:

\[
    \begin{equation}
    \text{kernel}(\mathbf{x}, \mathbf{y}) = \left\langle \mathbf{x}, \mathbf{y} \right \rangle.
    \end{equation}
\]

Attributes:

Name Type Description
kernel Callable

The linear kernel function.

Methods:

Name Description
__init__

Initializes the linear kernel interdependence function.

Source code in tinybig/interdependence/numerical_kernel_interdependence.py
class linear_kernel_interdependence(numerical_kernel_based_interdependence):
    r"""
        A kernel-based interdependence class using a linear kernel.

        Notes
        ----------
        __Linear (Inner-Product) Kernel:__

        $$
            \begin{equation}
            \text{kernel}(\mathbf{x}, \mathbf{y}) = \left\langle \mathbf{x}, \mathbf{y} \right \rangle.
            \end{equation}
        $$

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

        Methods
        -------
        __init__(...)
            Initializes the linear kernel interdependence function.
    """
    def __init__(self, name: str = 'linear_kernel_interdependence', *args, **kwargs):
        """
            Initializes the linear kernel interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'linear_kernel_interdependence'.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        super().__init__(kernel=linear_kernel, name=name, *args, **kwargs)

__init__(name='linear_kernel_interdependence', *args, **kwargs)

Initializes the linear kernel interdependence function.

Parameters:

Name Type Description Default
name str

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

'linear_kernel_interdependence'
*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 = 'linear_kernel_interdependence', *args, **kwargs):
    """
        Initializes the linear kernel interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'linear_kernel_interdependence'.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    super().__init__(kernel=linear_kernel, name=name, *args, **kwargs)