0

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

jsky
  • 2,225
  • 5
  • 38
  • 54

1 Answers1

1

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.

honi
  • 946
  • 1
  • 7
  • 18
  • thanks this sounds good. i was thinking similar with a timestamp, dunno why i didnt think params, im tired :) – jsky Apr 24 '14 at 14:25