MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / max_norm_

Method max_norm_

models/TABL/bin_tabl.py:37–42  ·  view source on GitHub ↗
(self, w)

Source from the content-addressed store, hash-verified

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
45class BiN_CTABL(pl.LightningModule):

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected