Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
853 B
2
Indexable
Never
training_loss = np.zeros((config.epochs,1))
training_accuracy = np.zeros((config.epochs,1))
eval_loss = np.zeros((config.epochs,1))
eval_accuracy = np.zeros((config.epochs,1))



# inside the loop

            training_loss[e] = metrics['loss']
            training_accuracy[e] = metrics['accuracy']
            eval_loss[e] = eval_metrics['loss']
            eval_accuracy[e] = eval_metrics['accuracy']


#outside the loop

#torch.save(single_mt.state_dict(), args.model_dir+'/final.pth'.format(idx))

from pathlib import Path

path = Path('/plot_variables/').expanduser()
path.mkdir(parents=True, exist_ok=True)
np.save(path/'training_loss', training_loss)
np.save(path/'training_accuracy', training_accuracy)
np.save(path/'eval_loss', eval_loss)
np.save(path/'eval_accuracy', eval_accuracy)

#eval_summary_writer.close()
#train_summary_writer.close()