cosine_similarity_interdependence
Bases: numerical_kernel_based_interdependence
A kernel-based interdependence class using a cosine similarity kernel.
Notes
Cosine Similarity based Kernel:
\[ \begin{equation} \text{kernel}(\mathbf{x}, \mathbf{y}) = \frac{\left\langle \mathbf{x}, \mathbf{y} \right \rangle}{\left\|\mathbf{x}\right\| \cdot \left\| \mathbf{y} \right\|}. \end{equation} \]
Attributes:
Name | Type | Description |
---|---|---|
kernel |
Callable
|
The cosine similarity kernel function. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the cosine similarity interdependence function. |
Source code in tinybig/interdependence/numerical_kernel_interdependence.py
__init__(name='cosine_similarity_interdependence', *args, **kwargs)
Initializes the cosine similarity interdependence function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the interdependence function. Defaults to 'cosine_similarity_interdependence'. |
'cosine_similarity_interdependence'
|
*args
|
tuple
|
Additional positional arguments for the parent class. |
()
|
**kwargs
|
dict
|
Additional keyword arguments for the parent class. |
{}
|