keras: how to save the training history attribute of the history object

前端 未结 8 2039
小鲜肉
小鲜肉 2020-12-12 23:43

In Keras, we can return the output of model.fit to a history as follows:

 history = model.fit(X_train, y_train, 
                     batch_size         


        
8条回答
  •  庸人自扰
    2020-12-12 23:54

    The easiest way:

    Saving:

    np.save('my_history.npy',history.history)
    

    Loading:

    history=np.load('my_history.npy',allow_pickle='TRUE').item()
    

    Then history is a dictionary and you can retrieve all desirable values using the keys.

提交回复
热议问题