I want to save the history to a file, in Keras I havemodel.fit
历史=model.fit(Q_train,W_train,
batch_size=batch_size,
nb_epoch=nb_epoch,
validation_data=(Q_t, W_test))
You can try this code:
import json
历史=model.fit(Q_train, W_train, epochs=5, batch_size=batch_size,validation_split=0.1)
with open('myfile.json', 'w') as file:
json.dump(history.history, file)