(self, w)
| 35 | return x |
| 36 | |
| 37 | def max_norm_(self, w): |
| 38 | with torch.no_grad(): |
| 39 | if (torch.linalg.matrix_norm(w) > 10.0): |
| 40 | norm = torch.linalg.matrix_norm(w) |
| 41 | desired = torch.clamp(norm, min=0.0, max=10.0) |
| 42 | w *= (desired / (1e-8 + norm)) |
| 43 | |
| 44 | |
| 45 | class BiN_CTABL(pl.LightningModule): |