|
@@ -5,7 +5,7 @@
|
|
|
# @Author :David
|
|
|
# @Company: shenyang JY
|
|
|
from tensorflow.keras.models import Sequential
|
|
|
-from tensorflow.keras.layers import Input, Dense, LSTM, concatenate, Conv1D, Conv2D, MaxPooling1D, Reshape, Flatten
|
|
|
+from tensorflow.keras.layers import Input, Dense, LSTM, concatenate, Conv1D, Conv2D, MaxPooling1D, Reshape, Flatten, Dropout
|
|
|
from tensorflow.keras.models import Model, load_model
|
|
|
from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping, TensorBoard, ReduceLROnPlateau
|
|
|
from tensorflow.keras import optimizers, regularizers
|
|
@@ -40,7 +40,9 @@ class BPHandler(object):
|
|
|
loss = region_loss(opt)
|
|
|
model = Sequential([
|
|
|
Dense(64, input_dim=opt.Model['input_size'], activation='relu'), # 输入层和隐藏层,10个神经元
|
|
|
+ Dropout(0.2),
|
|
|
Dense(32, activation='relu'), # 隐藏层,8个神经元
|
|
|
+ Dropout(0.3),
|
|
|
Dense(16, activation='relu'), # 隐藏层,8个神经元
|
|
|
Dense(1, activation='linear') # 输出层,1个神经元(用于回归任务)
|
|
|
])
|