(self, lighten, num_snapshots=100, hidden_size=128)
| 5 | |
| 6 | class 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] |
nothing calls this directly
no outgoing calls
no test coverage detected