3-Layer classifier for ETH/BTC dataset.
| 72 | |
| 73 | |
| 74 | class Simple_3_Layer_Classifier(nn.Module): |
| 75 | """ |
| 76 | 3-Layer classifier for ETH/BTC dataset. |
| 77 | """ |
| 78 | def __init__(self, dataset_ref, h1_dim=128, h2_dim=64): |
| 79 | |
| 80 | super(Simple_3_Layer_Classifier, self).__init__() |
| 81 | |
| 82 | # --- Save the dims --- |
| 83 | self.x_dim = dataset_ref.get_input_dim() |
| 84 | self.out_dim = dataset_ref.get_output_dim() |
| 85 | self.h1_dim, self.h2_dim = h1_dim, h2_dim |
| 86 | |
| 87 | # --- Layers --- |
| 88 | self.linear_1 = nn.Linear(in_features=self.x_dim, out_features=self.h1_dim) |
| 89 | self.activ_1 = nn.ReLU() |
| 90 | self.linear_2 = nn.Linear(in_features=self.h1_dim, out_features=self.h2_dim) |
| 91 | self.activ_2 = nn.ReLU() |
| 92 | self.linear_3 = nn.Linear(in_features=self.h2_dim, out_features=self.out_dim) |
| 93 | |
| 94 | def forward(self, x): |
| 95 | h1 = self.activ_1(self.linear_1(x)) |
| 96 | h2 = self.activ_2(self.linear_2(h1)) |
| 97 | out = self.linear_3(h2) |
| 98 | return out |
| 99 | |
| 100 | |
| 101 | class Simple_5_Layer_Classifier(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected