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

Method __init__

models/DLA/DLA.py:7–28  ·  view source on GitHub ↗
(self, lighten, num_snapshots=100, hidden_size=128)

Source from the content-addressed store, hash-verified

5
6class DLA(pl.LightningModule):
7 def __init__(self, lighten, num_snapshots=100, hidden_size=128):
8 super().__init__()
9 self.name = "mlp"
10 num_features = 40
11 if lighten:
12 self.name += "-lighten"
13 num_features = 20
14
15 self.W1 = nn.Linear(num_features, num_features, bias=False)
16
17 self.softmax = nn.Softmax(dim=1)
18
19 self.gru = nn.GRU(
20 input_size=num_features,
21 hidden_size=hidden_size,
22 num_layers=2,
23 batch_first=True,
24 dropout=0.5
25 )
26
27 self.W2 = nn.Linear(hidden_size, hidden_size, bias=False)
28 self.W3 = nn.Linear(num_snapshots*hidden_size, 3)
29
30 def forward(self, x):
31 # x.shape = [batch_size, num_snapshots, num_features]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected