質問編集履歴

2

誤字の修正

2022/06/17 02:12

投稿

hoto
hoto

スコア23

test CHANGED
File without changes
test CHANGED
@@ -1,7 +1,7 @@
1
1
  Kerasのmodel.fitにvalidation_dataを入れると学習が異常に遅くなります.
2
2
 
3
3
  model=Sequential()
4
- model.add(Dense(14, activation="tanh", input_dim=2, kernel_regularizer = regularizers.l2(0.03)))
4
+ model.add(Dense(14, activation="tanh", input_dim=6, kernel_regularizer = regularizers.l2(0.03)))
5
5
  model.add(Dense(1, activation="linear", input_dim=14))
6
6
  model.compile(loss="mean_squared_error", optimizer=tf.optimizers.Adam(learning_rate=0.02), metrics=[tf.keras.metrics.RootMeanSquaredError()])
7
7
  num_epoch=300

1

誤字の修正

2022/06/17 02:10

投稿

hoto
hoto

スコア23

test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  batch_size=8
10
10
  history = model.fit(X_train_std, Y_train_std, epochs=num_epoch, batch_size=batch_size, validation_data=(X_val_std, Y_val_std))
11
- これで実行すると約2分ほど学習に時間がかかります.(X_train_stdは(24,6)で,X_train_stdは(5,6)の配列です)
11
+ これで実行すると約2分ほど学習に時間がかかります.(X_train_stdは(24,6)で,X_val_stdは(5,6)の配列です)
12
12
 
13
13
  model.fitの部分でvalidation_data=(X_val_std, Y_val_std)を除いた
14
14
  history = model.fit(X_train_std, Y_train_std, epochs=num_epoch, batch_size=batch_size)