MCPcopy Create free account
hub / github.com/Modulus-Labs/RockyBot / Simple_5_Layer_Classifier

Class Simple_5_Layer_Classifier

pytorch-model/models.py:101–131  ·  view source on GitHub ↗

5-Layer classifier for ETH/BTC dataset.

Source from the content-addressed store, hash-verified

99
100
101class Simple_5_Layer_Classifier(nn.Module):
102 """
103 5-Layer classifier for ETH/BTC dataset.
104 """
105 def __init__(self, dataset_ref, h1_dim=128, h2_dim=256, h3_dim=256, h4_dim=128):
106
107 super(Simple_5_Layer_Classifier, self).__init__()
108
109 # --- Save the dims ---
110 self.x_dim = dataset_ref.get_input_dim()
111 self.out_dim = dataset_ref.get_output_dim()
112 self.h1_dim, self.h2_dim, self.h3_dim, self.h4_dim = h1_dim, h2_dim, h3_dim, h4_dim
113
114 # --- Layers ---
115 self.linear_1 = nn.Linear(in_features=self.x_dim, out_features=self.h1_dim)
116 self.activ_1 = nn.ReLU()
117 self.linear_2 = nn.Linear(in_features=self.h1_dim, out_features=self.h2_dim)
118 self.activ_2 = nn.ReLU()
119 self.linear_3 = nn.Linear(in_features=self.h2_dim, out_features=self.h3_dim)
120 self.activ_3 = nn.ReLU()
121 self.linear_4 = nn.Linear(in_features=self.h3_dim, out_features=self.h4_dim)
122 self.activ_4 = nn.ReLU()
123 self.linear_5 = nn.Linear(in_features=self.h4_dim, out_features=self.out_dim)
124
125 def forward(self, x):
126 h1 = self.activ_1(self.linear_1(x))
127 h2 = self.activ_2(self.linear_2(h1))
128 h3 = self.activ_3(self.linear_3(h2))
129 h4 = self.activ_4(self.linear_4(h3))
130 out = self.linear_5(h4)
131 return out
132
133
134class Simple_LSTM_Classifier(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected