i am trying to train model with kfold cross validation , now i want to keep history for plotting and saving the history. how can i do that?
it seems that some questions post answers of this question but i want to save and plot all history once, not with parted files
num_folds = 10
kfold = KFold(n_splits=num_folds, shuffle=True)
# K-fold Cross Validation model evaluation
fold_no = 1
a = []
for train, test in kfold.split(X, label):
print("---"*20)
history = siamese.fit(
[tf.gather(X[:,0], train),tf.gather(X[:,1], train)],
tf.gather(label, train),
validation_data=([tf.gather(X[:,0], test),tf.gather(X[:,1], test)], tf.gather(label, test)),
batch_size=batch_size,
epochs=epochs,
)
a.append(history)