我正在尝试为文本分类建立模型,而我的accuracy
,loss
,val_accuracy
和val_loss
不变。有什么问题吗?
loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1261/3000
493/493 [==============================] - 0s 160us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1262/3000
493/493 [==============================] - 0s 197us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1263/3000
493/493 [==============================] - 0s 170us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1264/3000
493/493 [==============================] - 0s 162us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1265/3000
493/493 [==============================] - 0s 168us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1266/3000
493/493 [==============================] - 0s 167us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1267/3000
493/493 [==============================] - 0s 167us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
Epoch 1268/3000
493/493 [==============================] - 0s 176us/step - loss: 0.7193 - accuracy: 0.9026 - val_loss: 4.3244 - val_accuracy: 0.8537
和模型预测相同:
[ 0.22973481, -0.20327136],
[ 0.2236712 , -0.21135806],
[ 0.23193322, -0.13985021],
[ 0.2548868 , -0.16937284],
[ 0.20090859, -0.2029791 ],
[ 0.22503227, -0.18626921],
[ 0.29060254, -0.19403042],
[ 0.14675425, -0.14986442],
[ 0.24112506, -0.18059473],
[ 0.2492715 , -0.20630237],
[ 0.2019249 , -0.16592667],
[ 0.16203514, -0.21538939],
[ 0.26369253, -0.16185832],
[ 0.26543748, -0.15609248],
[ 0.26092687, -0.27325732],
[ 0.28084713, -0.18308167],
p.s这是我的模特:
model = Sequential()
model.add(Embedding(1088, 36, input_length = 36))
model.add(keras.layers.Flatten())
model.add(Dense(2))
model.summary()
model.compile(optimizer = 'adam',
loss = 'categorical_crossentropy',
metrics=['accuracy'])
model.fit(x_train,
y_train,
batch_size=32,
epochs=3000,
validation_data = (x_test, y_test))