我的简单回归模型(通过 keras)不起作用



我是学习神经网络的初学者。我正在做kaggle项目-共享单车需求。我想使用keras的简单神经网络,但损失并没有减少。我该怎么办?

-----------代码---------------

# dataset from pandas
feature_names = ["season", "holiday", "workingday", "weather",
"temp", "atemp", "humidity", "windspeed",
"datetime_year", "datetime_hour", "datetime_dayofweek"]
label_name = ["count"]
X_train = train[feature_names]   #shape (10886, 11)
Y_train = train[label_name]      #shape (10886, 1)
X_test = test[feature_names]
# layers
model = Sequential()
model.add(Dense(units = 50, kernel_initializer = 'uniform', activation = 'relu', input_dim=11))
model.add(Dropout(0.3))
model.add(Dense(units = 50, kernel_initializer = 'uniform', activation = 'relu'))
model.add(Dropout(0.3))
model.add(Dense(units = 5, kernel_initializer = 'uniform', activation = 'relu'))
model.add(Dropout(0.3))
model.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))

model.compile(optimizer = 'adam', loss = 'mean_squared_error', metrics = ['accuracy'])
# Train
model.fit(X_train, Y_train, batch_size = 100, epochs = 200)

---------结果--------------

Epoch 1/200
10886/10886 [==============================] - 4s 325us/step - loss: 69206.2478 - acc: 0.0094
Epoch 2/200
10886/10886 [==============================] - 1s 93us/step - loss: 69184.5435 - acc: 0.0096
Epoch 3/200
10886/10886 [==============================] - 1s 89us/step - loss: 69181.6330 - acc: 0.0096
Epoch 4/200
10886/10886 [==============================] - 1s 93us/step - loss: 69179.0222 - acc: 0.0096
Epoch 5/200
10886/10886 [==============================] - 1s 91us/step - loss: 69175.7442 - acc: 0.0096
Epoch 6/200
10886/10886 [==============================] - 1s 109us/step - loss: 69171.9052 - acc: 0.0096
Epoch 7/200
10886/10886 [==============================] - 1s 122us/step - loss: 69171.6164 - acc: 0.0096
Epoch 8/200
10886/10886 [==============================] - 1s 92us/step - loss: 69167.6923 - acc: 0.0096
Epoch 9/200
10886/10886 [==============================] - 1s 91us/step - loss: 69166.2911 - acc: 0.0096
Epoch 10/200
10886/10886 [==============================] - 1s 94us/step - loss: 69164.1145 - acc: 0.0096
...

尝试在model.compile部分设置学习率。从0.0001开始,然后是0.0010.01,看看会发生什么。