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

Method __init__

models/TABL/tabl_layer.py:7–31  ·  view source on GitHub ↗
(self, d2, d1, t1, t2)

Source from the content-addressed store, hash-verified

5
6class TABL_layer(pl.LightningModule):
7 def __init__(self, d2, d1, t1, t2):
8 super().__init__()
9 self.t1 = t1
10
11 weight = torch.Tensor(d2, d1)
12 self.W1 = nn.Parameter(weight)
13 nn.init.kaiming_uniform_(self.W1, nonlinearity='relu')
14
15 weight2 = torch.Tensor(t1, t1)
16 self.W = nn.Parameter(weight2)
17 nn.init.constant_(self.W, 1 / t1)
18
19 weight3 = torch.Tensor(t1, t2)
20 self.W2 = nn.Parameter(weight3)
21 nn.init.kaiming_uniform_(self.W2, nonlinearity='relu')
22
23 bias1 = torch.Tensor(d2, t2)
24 self.B = nn.Parameter(bias1)
25 nn.init.constant_(self.B, 0)
26
27 l = torch.Tensor(1, )
28 self.l = nn.Parameter(l)
29 nn.init.constant_(self.l, 0.5)
30
31 self.activation = nn.ReLU()
32
33 def forward(self, X):
34

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected