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

Method forward

models/TABL/bin_tabl.py:55–77  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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():

Callers

nothing calls this directly

Calls 1

max_norm_Method · 0.95

Tested by

no test coverage detected