Skip to content

anisotropic_rbf_kernel_interdependence

Bases: numerical_kernel_based_interdependence

A kernel-based interdependence class using the anisotropic RBF (Radial Basis Function) kernel.

Notes

Anisotropic RBF Kernel:

$$ \begin{equation} \text{kernel}(\mathbf{x}, \mathbf{y}) = \exp \left( - (\mathbf{x} - \mathbf{y}) \mathbf{A} (\mathbf{x} - \mathbf{y})^\top \right), \end{equation} $$ where \(\mathbf{A} = \text{diag}(\mathbf{a})\) is a diagonal matrix.

Attributes:

Name Type Description
kernel Callable

The anisotropic RBF kernel function.

Methods:

Name Description
__init__

Initializes the anisotropic RBF kernel interdependence function.

Source code in tinybig/interdependence/numerical_kernel_interdependence.py
class anisotropic_rbf_kernel_interdependence(numerical_kernel_based_interdependence):
    r"""
        A kernel-based interdependence class using the anisotropic RBF (Radial Basis Function) kernel.

        Notes
        ----------
        __Anisotropic RBF Kernel:__

        $$
            \begin{equation}
            \text{kernel}(\mathbf{x}, \mathbf{y}) = \exp \left( - (\mathbf{x} - \mathbf{y}) \mathbf{A} (\mathbf{x} - \mathbf{y})^\top \right),
            \end{equation}
        $$
        where $\mathbf{A} = \text{diag}(\mathbf{a})$ is a diagonal matrix.

        Attributes
        ----------
        kernel : Callable
            The anisotropic RBF kernel function.

        Methods
        -------
        __init__(...)
            Initializes the anisotropic RBF kernel interdependence function.
    """
    def __init__(self, name: str = 'anisotropic_rbf_kernel_interdependence', a_vector: Union[torch.Tensor, np.array] = None, a_scalar: float = 1.0, *args, **kwargs):
        """
            Initializes the anisotropic RBF kernel interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'anisotropic_rbf_kernel_interdependence'.
            a_vector : Union[torch.Tensor, np.array], optional
                Vector of scaling factors for each dimension. Defaults to None.
            a_scalar : float, optional
                Scalar scaling factor applied uniformly to all dimensions. Defaults to 1.0.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        anisotropic_rbf_kernel_func = functools.partial(anisotropic_rbf_kernel, a_vector=a_vector, a_scalar=a_scalar)
        super().__init__(kernel=anisotropic_rbf_kernel_func, name=name, *args, **kwargs)

__init__(name='anisotropic_rbf_kernel_interdependence', a_vector=None, a_scalar=1.0, *args, **kwargs)

Initializes the anisotropic RBF kernel interdependence function.

Parameters:

Name Type Description Default
name str

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

'anisotropic_rbf_kernel_interdependence'
a_vector Union[Tensor, array]

Vector of scaling factors for each dimension. Defaults to None.

None
a_scalar float

Scalar scaling factor applied uniformly to all dimensions. 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 = 'anisotropic_rbf_kernel_interdependence', a_vector: Union[torch.Tensor, np.array] = None, a_scalar: float = 1.0, *args, **kwargs):
    """
        Initializes the anisotropic RBF kernel interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'anisotropic_rbf_kernel_interdependence'.
        a_vector : Union[torch.Tensor, np.array], optional
            Vector of scaling factors for each dimension. Defaults to None.
        a_scalar : float, optional
            Scalar scaling factor applied uniformly to all dimensions. Defaults to 1.0.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    anisotropic_rbf_kernel_func = functools.partial(anisotropic_rbf_kernel, a_vector=a_vector, a_scalar=a_scalar)
    super().__init__(kernel=anisotropic_rbf_kernel_func, name=name, *args, **kwargs)