| 53 | self.dropout = nn.Dropout(0.1) |
| 54 | |
| 55 | def forward(self, x): |
| 56 | x = x.squeeze(1) |
| 57 | # first of all we pass the input to the BiN layer, then we use the C(TABL) architecture |
| 58 | x = torch.permute(x, (0, 2, 1)) |
| 59 | |
| 60 | x = self.BiN(x) |
| 61 | |
| 62 | self.max_norm_(self.BL.W1.data) |
| 63 | self.max_norm_(self.BL.W2.data) |
| 64 | x = self.BL(x) |
| 65 | x = self.dropout(x) |
| 66 | |
| 67 | self.max_norm_(self.BL2.W1.data) |
| 68 | self.max_norm_(self.BL2.W2.data) |
| 69 | x = self.BL2(x) |
| 70 | x = self.dropout(x) |
| 71 | |
| 72 | self.max_norm_(self.TABL.W1.data) |
| 73 | self.max_norm_(self.TABL.W.data) |
| 74 | self.max_norm_(self.TABL.W2.data) |
| 75 | x = self.TABL(x) |
| 76 | x = torch.squeeze(x, 2) |
| 77 | return x |
| 78 | |
| 79 | def max_norm_(self, w): |
| 80 | with torch.no_grad(): |