Я хочу предсказать идеальные линейные данные (идентичная функция)
data = np.asarray(range(100),dtype=np.float32)
Я использую эту линейную функцию
model = Sequential([
Dense(1, input_shape=(1,))
])
model.compile(optimizer='sgd', loss='mse')
model.fit(data, data, epochs=10, batch_size=100)
но моя функция потери увеличивается. Что не так с этим простым кодом?
Epoch 1/10
100/100 [==============================] - 1s 7ms/step - loss: 3559.4075
Epoch 2/10
100/100 [==============================] - 0s 20us/step - loss: 14893056.0000
Epoch 3/10
100/100 [==============================] - 0s 170us/step - loss: 62314639360.0000
Epoch 4/10
100/100 [==============================] - 0s 30us/step - loss: 260733187129344.0000
Epoch 5/10
100/100 [==============================] - 0s 70us/step - loss: 1090944439330799616.0000
Epoch 6/10
100/100 [==============================] - 0s 20us/step - loss: 4564665060617919397888.0000
Epoch 7/10
100/100 [==============================] - 0s 30us/step - loss: 19099198494067630815576064.0000
Epoch 8/10
100/100 [==============================] - 0s 30us/step - loss: 79913699011849558249925771264.0000
Epoch 9/10
100/100 [==============================] - 0s 50us/step - loss: 334370041805433555342669660553216.0000
Epoch 10/10
100/100 [==============================] - 0s 20us/step - loss: 1399051141583436919510296595359858688.0000