timesead.models.layers.multi_wavelet_correlation

Classes

MultiWaveletTransform

1D multiwavelet block.

MultiWaveletCross

1D Multiwavelet Cross Attention layer.

FourierCrossAttentionW

Base class for all neural network modules.

sparseKernelFT1d

Base class for all neural network modules.

MWT_CZ1d

Base class for all neural network modules.

Functions

legendreDer(k, x)

phi_(phi_c, x[, lb, ub])

get_phi_psi(k, base)

get_filter(base, k)

Module Contents

timesead.models.layers.multi_wavelet_correlation.legendreDer(k, x)
timesead.models.layers.multi_wavelet_correlation.phi_(phi_c, x, lb=0, ub=1)
timesead.models.layers.multi_wavelet_correlation.get_phi_psi(k, base)
timesead.models.layers.multi_wavelet_correlation.get_filter(base, k)
class timesead.models.layers.multi_wavelet_correlation.MultiWaveletTransform(ich=1, k=8, alpha=16, c=128, nCZ=1, L=0, base='legendre', attention_dropout=0.1)

Bases: torch.nn.Module

1D multiwavelet block.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

k = 8
c = 128
L = 0
nCZ = 1
Lk0
Lk1
ich = 1
MWT_CZ
forward(queries, keys, values, attn_mask)
class timesead.models.layers.multi_wavelet_correlation.MultiWaveletCross(in_channels, out_channels, seq_len_q, seq_len_kv, modes, c=64, k=8, ich=512, L=0, base='legendre', mode_select_method='random', initializer=None, activation='tanh', **kwargs)

Bases: torch.nn.Module

1D Multiwavelet Cross Attention layer.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

c = 64
k = 8
L = 0
max_item = 3
attn1
attn2
attn3
attn4
T0
Lk
Lq
Lv
out
modes1
forward(q, k, v, mask=None)
wavelet_transform(x)
evenOdd(x)
class timesead.models.layers.multi_wavelet_correlation.FourierCrossAttentionW(in_channels, out_channels, seq_len_q, seq_len_kv, modes=16, activation='tanh', mode_select_method='random')

Bases: torch.nn.Module

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing them to be nested in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self) -> None:
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will also have their parameters converted when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

in_channels
out_channels
modes1 = 16
activation = 'tanh'
compl_mul1d(order, x, weights)
forward(q, k, v, mask)
class timesead.models.layers.multi_wavelet_correlation.sparseKernelFT1d(k, alpha, c=1, nl=1, initializer=None, **kwargs)

Bases: torch.nn.Module

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing them to be nested in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self) -> None:
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will also have their parameters converted when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

modes1
scale
weights1
weights2
k
compl_mul1d(order, x, weights)
forward(x)
class timesead.models.layers.multi_wavelet_correlation.MWT_CZ1d(k=3, alpha=64, L=0, c=1, base='legendre', initializer=None, **kwargs)

Bases: torch.nn.Module

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing them to be nested in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self) -> None:
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will also have their parameters converted when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

k = 3
L = 0
max_item = 3
A
B
C
T0
forward(x)
wavelet_transform(x)
evenOdd(x)