|
@@ -18,16 +18,16 @@ from keras.callbacks import EarlyStopping
|
18
|
18
|
|
19
|
19
|
early_stopping = EarlyStopping(monitor='accuracy', patience=5, verbose=2)
|
20
|
20
|
|
21
|
|
-epochs= 8
|
22
|
|
-size = 10000 #18W 60W
|
23
|
|
-file_path = 'D:\\data\\quantization\\stock300_18d_train2.log'
|
24
|
|
-model_path = '300_18d_mix_6D_ma5_s_seq.h5'
|
25
|
|
-file_path1='D:\\data\\quantization\\stock300_18d_test.log'
|
26
|
|
-col = 18
|
|
21
|
+epochs= 88
|
|
22
|
+size = 400000 #18W 60W
|
|
23
|
+file_path = 'D:\\data\\quantization\\stock302_18d_train2.log'
|
|
24
|
+model_path = '302_18d_mix_6D_ma5_s_seq.h5'
|
|
25
|
+file_path1='D:\\data\\quantization\\stock302_18d_test.log'
|
|
26
|
+col = 20
|
27
|
27
|
'''
|
28
|
|
-ROC 30*18
|
29
|
|
-DMI 30*20
|
30
|
|
-MACD 30*19
|
|
28
|
+ROC 30*18 38,100,17
|
|
29
|
+DMI 30*20 39,101,13
|
|
30
|
+MACD 30*19
|
31
|
31
|
RSI 30*17
|
32
|
32
|
|
33
|
33
|
'''
|
|
@@ -77,8 +77,10 @@ train_x_c = train_x[:,30*col:]
|
77
|
77
|
def create_mlp(dim, regress=False):
|
78
|
78
|
# define our MLP network
|
79
|
79
|
model = Sequential()
|
80
|
|
- model.add(Dense(128, input_dim=dim, activation="relu"))
|
|
80
|
+ model.add(Dense(256, input_dim=dim, activation="relu"))
|
81
|
81
|
model.add(Dropout(0.2))
|
|
82
|
+ model.add(Dense(256, activation="relu"))
|
|
83
|
+ model.add(Dense(256, activation="relu"))
|
82
|
84
|
model.add(Dense(128, activation="relu"))
|
83
|
85
|
|
84
|
86
|
# check to see if the regression node should be added
|
|
@@ -149,9 +151,8 @@ x = Dense(1024, activation="relu", kernel_regularizer=regularizers.l1(0.003))(co
|
149
|
151
|
x = Dropout(0.2)(x)
|
150
|
152
|
x = Dense(1024, activation="relu")(x)
|
151
|
153
|
x = Dense(1024, activation="relu")(x)
|
152
|
|
-x = Dense(1024, activation="relu")(x)
|
153
|
154
|
# 在建设一层
|
154
|
|
-x = Dense(3, activation="softmax")(x)
|
|
155
|
+x = Dense(4, activation="softmax")(x)
|
155
|
156
|
|
156
|
157
|
# our final model will accept categorical/numerical data on the MLP
|
157
|
158
|
# input and images on the CNN input, outputting a single value (the
|