更新时间:2023-12-02 11:53:40
这是一样的,因为你是在测试集上训练,而不是在训练集上.不要那样做,只需在训练集上训练:
It is the same because you are training on the test set, not on the train set. Don't do that, just train on the training set:
history = model.fit(x_test, y_test, nb_epoch=10, validation_split=0.2, shuffle=True)
变成:
history = model.fit(x_train, y_train, nb_epoch=10, validation_split=0.2, shuffle=True)