@@ -172,3 +172,37 @@ def _transform(self):
172
172
w2 *= max_route_length
173
173
self ._transform_ws = [w1 , w2 , w3 ]
174
174
self ._transform_bs = [b ]
175
+
176
+
177
+ if __name__ == '__main__' :
178
+ from _Dist .NeuralNetworks .c_BasicNN .NN import Basic
179
+ from _Dist .NeuralNetworks .e_AdvancedNN .NN import Advanced
180
+
181
+ with open ("../../../_Data/madelon.txt" , "r" ) as file :
182
+ data = [line .strip ().split () for line in file ]
183
+ train , test = np .array (data [:2000 ], np .float32 ), np .array (data [2000 :], np .float32 )
184
+ np .random .shuffle (train )
185
+ x , y = train [..., :- 1 ], train [..., - 1 ]
186
+ x_test , y_test = test [..., :- 1 ], test [..., - 1 ]
187
+ x -= x .mean ()
188
+ x /= x .std ()
189
+ x_test -= x_test .mean ()
190
+ x_test /= x_test .std ()
191
+
192
+ Advanced (
193
+ name = "madelon" ,
194
+ data_info = {
195
+ "numerical_idx" : [True ] * 500 + [False ],
196
+ "categorical_columns" : []
197
+ },
198
+ model_param_settings = {
199
+ "lr" : 1e-3 ,
200
+ "keep_prob" : 0.25 ,
201
+ "use_batch_norm" : False ,
202
+ "activations" : ["relu" , "relu" ]
203
+ }, model_structure_settings = {
204
+ "use_pruner" : False ,
205
+ "use_wide_network" : False ,
206
+ "hidden_units" : [152 , 153 ]
207
+ }
208
+ ).fit (x , y , x_test , y_test , snapshot_ratio = 1 )
0 commit comments