Ere*_*she 5 python linear-regression deep-learning keras tensorflow
我正在尝试预测连续值(第一次使用神经网络)。我已经标准化了输入数据。我不明白为什么我loss: nan从第一个纪元开始就得到输出。
我阅读并尝试了以前对同一问题的答案中的许多建议,但没有一个对我有帮助。我的训练数据形状是:(201917, 64)。这是我的代码:
model = Sequential()
model.add(Dense(100, input_dim=X.shape[1], activation='relu'))
model.add(Dense(100, activation='relu'))
model.add(Dense(100, activation='relu'))
# Output layer
model.add(Dense(1, activation='linear'))
# Construct the neural network inside of TensorFlow
model.compile(loss='mean_squared_error', optimizer='Adam')
# train the model
model.fit(X_train, y_train, epochs=10, batch_size=32,
shuffle=True, verbose=2)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10374 次 |
| 最近记录: |