dual_lphm_parameterized_bilinear_interdependence
Bases: parameterized_bilinear_interdependence
A dual low-rank hierarchical mapping (Dual-LPHM) parameterized bilinear interdependence function.
This class extends the LPHM methodology to model dual low-rank approximations for interdependence matrices.
Notes
Formally, given a data batch \(\mathbf{X} \in R^{b \times m}\), we can represent the parameterized bilinear form-based interdependence function as follows:
\[ \begin{equation}\label{equ:bilinear_interdependence_function} \xi(\mathbf{X} | \mathbf{w}) = \mathbf{X}^\top \mathbf{W} \mathbf{X} = \mathbf{A} \in R^{m \times m}. \end{equation} \]
Notation \(\mathbf{W} \in R^{b \times b}\) denotes the parameter matrix fabricated from the learnable parameter vector \(\mathbf{w} \in R^{l_{\xi}}\), which can be represented as follows:
$$ \begin{equation} \psi(\mathbf{w}) = \mathbf{A} \otimes \mathbf{B} = ( \mathbf{P} \mathbf{Q}^\top) \otimes ( \mathbf{S} \mathbf{T}^\top) \in R^{b \times b}, \end{equation} $$ where \(\mathbf{P} \in R^{p \times r}\), \(\mathbf{Q} \in R^{q \times r}\), \(\mathbf{S} \in R^{\frac{b}{p} \times r}\) and \(\mathbf{T} \in R^{\frac{b}{q} \times r}\) are partitioned and reshaped from the parameter vector \(\mathbf{w}\).
The required length of parameter vector of this interdependence function is \(l_{\xi} = r \times (p + q + \frac{b}{p} + \frac{b}{q})\).
Attributes:
Name | Type | Description |
---|---|---|
r |
int
|
Rank of the low-rank approximation. |
p |
int
|
Number of partitions in the input dimension. |
q |
int
|
Number of partitions in the output dimension. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the dual low-rank hierarchical mapping parameterized bilinear interdependence function. |
Source code in tinybig/interdependence/parameterized_bilinear_interdependence.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 |
|
__init__(r, p, q=None, name='dual_lphm_parameterized_bilinear_interdependence', *args, **kwargs)
Initializes the dual low-rank hierarchical mapping parameterized bilinear interdependence function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r
|
int
|
Rank of the low-rank approximation. |
required |
p
|
int
|
Number of partitions in the input dimension. |
required |
q
|
int
|
Number of partitions in the output dimension. Defaults to |
None
|
name
|
str
|
Name of the interdependence function. Defaults to 'dual_lphm_parameterized_bilinear_interdependence'. |
'dual_lphm_parameterized_bilinear_interdependence'
|
*args
|
tuple
|
Additional positional arguments for the parent class. |
()
|
**kwargs
|
dict
|
Additional keyword arguments for the parent class. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If the interdependence type is not supported. |
AssertionError
|
If the dimensions are not divisible by the partitions. |