Commit bec06382 authored by David Maxence's avatar David Maxence
Browse files

modif

parent d4319c71
......@@ -75,8 +75,7 @@ def train_test_split(fold_k, data, X_dim=(128, 128, 1)):
def show_results(tot_history):
"""Show accuracy and loss graphs for train and test sets."""
pngName = ['result/res1.png','result/res2.png','result/res3.png','result/res4.png','result/res5.png','result/res6.png','result/res7.png',
'result/res8.png','result/res9.png','result/res10.png']
pngName = ['resultaugmented/res1.png','resultaugmented/res2.png','resultaugmented/res3.png','resultaugmented/res4.png','resultaugmented/res5.png','resultaugmented/res6.png','resultaugmented/res7.png','resultaugmented/res8.png','resultaugmented/res9.png','resultaugmented/res10.png']
for i, history in enumerate(tot_history):
print('\n({})'.format(i+1))
fig = plt.figure()
......@@ -100,8 +99,8 @@ def show_results(tot_history):
plt.savefig(pngName[i])
file = open('result/result.txt','a')
file.write('\n=========FOLD%s=========\n'% i+1)
file = open('resultaugmented/result.txt','a')
file.write('\n=========FOLD%s=========\n'% (i+1))
file.write('\nMax validation accuracy: %.4f %%' % (np.max(history.history['val_accuracy']) * 100))
file.write('\nMin validation loss: %.5f' % np.min(history.history['val_loss']))
......@@ -117,7 +116,7 @@ def process_fold(fold_k, data, epochs=100, num_batch_size=32):
model = init_model()
# pre-training accuracy
log_dir = "logs/fit/" + datetime.now().strftime("%Y%m%d-%H%M%S")
log_dir = "logs/fit/folds/" + datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir = log_dir, histogram_freq = 1)
......@@ -130,7 +129,7 @@ def process_fold(fold_k, data, epochs=100, num_batch_size=32):
if __name__ == "__main__":
us8k_df = pd.read_pickle("us8k_df.pkl")
us8k_df = pd.read_pickle("us8k_augmented_df.pkl")
history1 = []
for i in range(10) :
FOLD = i+1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment