(self, ich=1, k=8, alpha=16, c=128,
nCZ=1, L=0, base='legendre', attention_dropout=0.1)
| 40 | """ |
| 41 | |
| 42 | def __init__(self, ich=1, k=8, alpha=16, c=128, |
| 43 | nCZ=1, L=0, base='legendre', attention_dropout=0.1): |
| 44 | super(MultiWaveletTransform, self).__init__() |
| 45 | print('base', base) |
| 46 | self.k = k |
| 47 | self.c = c |
| 48 | self.L = L |
| 49 | self.nCZ = nCZ |
| 50 | self.Lk0 = nn.Linear(ich, c * k) |
| 51 | self.Lk1 = nn.Linear(c * k, ich) |
| 52 | self.ich = ich |
| 53 | self.MWT_CZ = nn.ModuleList(MWT_CZ1d(k, alpha, L, c, base) for i in range(nCZ)) |
| 54 | |
| 55 | def forward(self, queries, keys, values, attn_mask): |
| 56 | B, L, H, E = queries.shape |