Skip to content

hyperbolic_tangent_kernel_interdependence

Bases: numerical_kernel_based_interdependence

A kernel-based interdependence class using the hyperbolic tangent kernel.

Notes

Hyperbolic Tangent Kernel:

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

Attributes:

Name Type Description
kernel Callable

The hyperbolic tangent kernel function.

Methods:

Name Description
__init__

Initializes the hyperbolic tangent kernel interdependence function.

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

        Notes
        ----------
        __Hyperbolic Tangent Kernel:__

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

        Attributes
        ----------
        kernel : Callable
            The hyperbolic tangent kernel function.

        Methods
        -------
        __init__(...)
            Initializes the hyperbolic tangent kernel interdependence function.
    """
    def __init__(self, name: str = 'hyperbolic_tangent_kernel_interdependence', c: float = 0.0, alpha: float = 1.0, *args, **kwargs):
        """
            Initializes the hyperbolic tangent kernel interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'hyperbolic_tangent_kernel_interdependence'.
            c : float, optional
                Bias term of the hyperbolic tangent kernel. Defaults to 0.0.
            alpha : float, optional
                Scale factor of the hyperbolic tangent kernel. Defaults to 1.0.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        hyperbolic_tangent_kernel_func = functools.partial(hyperbolic_tangent_kernel, c=c, alpha=alpha)
        super().__init__(kernel=hyperbolic_tangent_kernel_func, name=name, *args, **kwargs)

__init__(name='hyperbolic_tangent_kernel_interdependence', c=0.0, alpha=1.0, *args, **kwargs)

Initializes the hyperbolic tangent kernel interdependence function.

Parameters:

Name Type Description Default
name str

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

'hyperbolic_tangent_kernel_interdependence'
c float

Bias term of the hyperbolic tangent kernel. Defaults to 0.0.

0.0
alpha float

Scale factor of the hyperbolic tangent 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 = 'hyperbolic_tangent_kernel_interdependence', c: float = 0.0, alpha: float = 1.0, *args, **kwargs):
    """
        Initializes the hyperbolic tangent kernel interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'hyperbolic_tangent_kernel_interdependence'.
        c : float, optional
            Bias term of the hyperbolic tangent kernel. Defaults to 0.0.
        alpha : float, optional
            Scale factor of the hyperbolic tangent kernel. Defaults to 1.0.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    hyperbolic_tangent_kernel_func = functools.partial(hyperbolic_tangent_kernel, c=c, alpha=alpha)
    super().__init__(kernel=hyperbolic_tangent_kernel_func, name=name, *args, **kwargs)