From ebfa67abb052a6cf5958408f3f202844419c78c3 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 7 Feb 2019 17:55:24 +0100 Subject: [PATCH] Fixed saving loss history Signed-off-by: Jim Martens --- src/twomartens/masterthesis/aae/train.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/twomartens/masterthesis/aae/train.py b/src/twomartens/masterthesis/aae/train.py index 6697c1b..eca0161 100644 --- a/src/twomartens/masterthesis/aae/train.py +++ b/src/twomartens/masterthesis/aae/train.py @@ -250,15 +250,15 @@ def train_mnist(folding_id: int, inlier_classes: Sequence[int], total_classes: i decoder.save_weights("./weights/decoder") z_discriminator.save_weights("./weights/z_discriminator") x_discriminator.save_weights("./weights/x_discriminator") - with open("./results0/losses/encoder_loss.txt", "w") as file: + with open("./results0/losses/encoder_loss.txt", "wb") as file: pickle.dump(encoder_loss_history, file) - with open("./results0/losses/decoder_loss.txt", "w") as file: + with open("./results0/losses/decoder_loss.txt", "wb") as file: pickle.dump(decoder_loss_history, file) - with open("./results0/losses/enc_dec_loss.txt", "w") as file: + with open("./results0/losses/enc_dec_loss.txt", "wb") as file: pickle.dump(enc_dec_loss_history, file) - with open("./results0/losses/xd_loss.txt", "w") as file: + with open("./results0/losses/xd_loss.txt", "wb") as file: pickle.dump(xd_loss_history, file) - with open("./results0/losses/zd_loss.txt", "w") as file: + with open("./results0/losses/zd_loss.txt", "wb") as file: pickle.dump(zd_loss_history, file)