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'))

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top