// save a dump of all sentences and the encoded latent space
if split == "valid":
dump = {"target_sents":tracker["target_sents"], "z":tracker["z"].tolist()}
os.makedirs("dumps/"+ts)
with open(os.path.join("dumps/"+ts+"/valid_E%i.json"%epoch), "w") as dump_file:
json.dump(dump,dump_file)
// save checkpoint
After Change
// save a dump of all sentences and the encoded latent space
if split == "valid":
dump = {"target_sents":tracker["target_sents"], "z":tracker["z"].tolist()}
if not os.path.exists(os.path.join("dumps", ts)):
os.makedirs("dumps/"+ts)
with open(os.path.join("dumps/"+ts+"/valid_E%i.json"%epoch), "w") as dump_file:
json.dump(dump,dump_file)
// save checkpoint