想請問為甚麼訓練出來的模型 預測的結果都是一樣的
預測的目標是 spal length
model = Sequential()
model.add(Dense(256, activation="sigmoid", input_dim=4))
model.add(Dense(128, activation="relu"))
model.add(Dense(1))
model.compile(optimizer = optimizers.SGD(learning_rate=0.1), loss = "mse", metrics="mse")
history = model.fit(feature_train, result_train, epochs=5, verbose=1, batch_size=2)
score = model.evaluate(feature_train, result_train)
print(f"loss:{score[0]}, mse:{score[1]}")
print(mean_squared_error(result_test, model.predict(feature_test)))
到這裡應該都沒有問題
可是當我要測試的時候 預測出來的結果卻都是一模一樣的
print( model.predict(feature_test))