meyer_wavelet_expansion
Bases: discrete_wavelet_expansion
Meyer Wavelet Expansion.
Applies the Meyer 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 Meyer wavelet, it can be represented as follows:
Meyer Wavelet:
\[ \begin{equation} \begin{aligned} &\phi(\tau) = \begin{cases} \frac{2}{3} + \frac{4}{3\pi} & \tau = 0,\\ \frac{ \sin(\frac{2 \pi}{3} \tau) + \frac{4}{3} \tau \cos( \frac{4 \pi}{3} \tau) }{ \pi \tau - \frac{16 \pi}{9} \tau^3 } & \text{otherwise}. \end{cases} \end{aligned} \end{equation} \]
Attributes:
Name | Type | Description |
---|---|---|
wavelet |
callable
|
Meyer wavelet function used during the transformation. |
Methods:
Name | Description |
---|---|
Inherits all methods from `discrete_wavelet_expansion`. |
|
Source code in tinybig/expansion/wavelet_expansion.py
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 |
|
__init__(name='meyer_wavelet_expansion', a=1.0, b=1.0, *args, **kwargs)
Initializes the Meyer wavelet expansion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the transformation. Defaults to 'meyer_wavelet_expansion'. |
'meyer_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
|
*args
|
tuple
|
Additional positional arguments. |
()
|
**kwargs
|
dict
|
Additional keyword arguments. |
{}
|