dog_wavelet_expansion
Bases: discrete_wavelet_expansion
Difference of Gaussians (DoG) Wavelet Expansion.
Applies the Difference of Gaussians (DoG) wavelet function for feature expansion.
Notes
Formally, given the input variable \(\mathbf{x} \in R^{m}\), to approximate the underlying mapping \(f: R^m \to R^n\) with wavelet analysis, we can define the approximated output as
\[ \begin{equation} f(\mathbf{x}) \approx \sum_{s, t} \left \langle f(\mathbf{x}), \phi_{s, t} (\mathbf{x} | a, b) \right \rangle \cdot \phi_{s, t} (\mathbf{x} | a, b), \end{equation} \]
where \(\phi_{s, t} (\cdot | a, b)\) denotes the child wavelet defined by hyper-parameters \(a > 1\) and \(b > 0\):
\[ \begin{equation} \phi_{s, t}(x | a, b) = \frac{1}{\sqrt{a^s}} \phi \left( \frac{x - t \cdot b \cdot a^s}{a^s} \right). \end{equation} \]
Based on the wavelet mapping \(\phi_{s, t} (\cdot | a, b)\), we can introduce the \(1_{st}\)-order and \(2_{nd}\)-order wavelet data expansion functions as follows:
\[ \begin{equation} \kappa(\mathbf{x} | d=1) = \left[ \phi_{0, 0}(\mathbf{x}), \phi_{0, 1}(\mathbf{x}), \cdots, \phi_{s, t}(\mathbf{x}) \right] \in R^{D_1}. \end{equation} \]
and
\[ \begin{equation} \kappa(\mathbf{x} | d=2) = \kappa(\mathbf{x} | d=1) \otimes \kappa(\mathbf{x} | d=1) \in R^{D_2}. \end{equation} \]
The output dimensions of the order-1 and order-2 wavelet expansions are \(D_1 = s \cdot t \cdot m\) and \(D_2 = (s \cdot t \cdot m)^2\), respectively.
Specifically, the functions \(\left\{ \phi_{s, t}\right\}_{ s, t \in Z}\) defines the orthonormal basis of the space and the mapping \(\phi(\cdot)\) used in the child wavelet may have different representations.
For DoG wavelet, it can be represented as follows:
DoG Wavelet:
$$ \begin{equation} \begin{aligned} &\phi(\tau | \sigma_1, \sigma_2) = {P}(\tau | 0, \sigma_1) - {P}(\tau | 0, \sigma_2), \end{aligned} \end{equation} $$ where \({P}(\cdot | 0, \sigma_1)\) denotes the PDF of the Gaussian distribution.
Attributes:
Name | Type | Description |
---|---|---|
wavelet |
callable
|
DoG wavelet function used during the transformation. |
Methods:
Name | Description |
---|---|
Inherits all methods from `discrete_wavelet_expansion`. |
|
Source code in tinybig/expansion/wavelet_expansion.py
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 |
|
__init__(name='dog_wavelet_expansion', a=1.0, b=1.0, sigma_1=1.0, sigma_2=2.0, *args, **kwargs)
Initializes the Difference of Gaussians (DoG) wavelet expansion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the transformation. Defaults to 'dog_wavelet_expansion'. |
'dog_wavelet_expansion'
|
a
|
float
|
The scaling factor for the wavelet. Defaults to 1.0. |
1.0
|
b
|
float
|
The translation factor for the wavelet. Defaults to 1.0. |
1.0
|
sigma_1
|
float
|
Standard deviation of the first Gaussian. Defaults to 1.0. |
1.0
|
sigma_2
|
float
|
Standard deviation of the second Gaussian. Defaults to 2.0. |
2.0
|
*args
|
tuple
|
Additional positional arguments. |
()
|
**kwargs
|
dict
|
Additional keyword arguments. |
{}
|