Domanda

Im running multiple PyBrain training runs using the same program but with diff params and saving to a pickle file.
How would i run the same program but save each instance to a different pickle (preferably without multithreading my program), so i can graph them all in the morning? Im using PyCharm so i can just run the program multiple times but at the moment it is overwriting the same file
pickle.dump(nn, open('NN.pkl','wb'))

È stato utile?

Soluzione

say you are using parameters a=2, b=3 for a particular run. write those parameter values into the file name using format():

filename = "NNa{0}b{1}.pk1".format(a,b)
pickle.dump(nn, open(filename,'wb'))

will give you a file NNa2b3.pk1.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top