def save_model(self, dir_name=None): import os if dir_name is None: dir_name = self.run_dir + '/snapshots/' if not os.path.isdir(dir_name): os.mkdir(dir_name) fname = dir_name + time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % self.itr) common.save_params(fname=fname, saver=self.saver, session=self.sess)
def save_model(self, dir_name=None, info=None): import os if dir_name is None: dir_name = os.path.join(self.run_dir, 'snapshots') if not os.path.isdir(dir_name): os.mkdir(dir_name) fname = os.path.join( dir_name, time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % self.itr)) common.save_params(fname=fname, saver=self.saver, session=self.sess) if info: with open(os.path.join(dir_name, 'log.txt'), 'a') as f: f.write("{0}: {1}\n".format(fname, info))
def save_model(self, dir_name=None, best=False, prefix=None): import os if dir_name is None: dir_name = self.run_dir + '/snapshots/' if not os.path.isdir(dir_name): os.mkdir(dir_name) if not best: fname = dir_name + time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % self.itr) else: fname = dir_name + 'best/' + prefix + '-best' common.save_params(fname=fname, saver=self.saver, session=self.sess)
def save_model(self, iter): common.save_params(fName=self.sn_dir + time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % iter), obj=common.get_params(self.model.params))
def save_model(self, iter): common.save_params(fName=self.sn_dir + time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % iter), saver=self.saver, session=self.sess)
def save_model(self, itr): common.save_params(fName=self.sn_dir + time.strftime("%Y-%m-%d-%H-%M-") +('%0.6d.sn'%itr), obj = common.get_params(self.model.param_struct[0].params + self.model.param_struct[1].params))
def save_model(self, dir_name=None): if dir_name is None: dir_name = self.run_dir + '/snapshots/' fname= dir_name + time.strftime("%Y-%m-%d-%H-%M-") + ('%0.6d.sn' % self.itr) common.save_params(fname=fname, saver=self.saver, session=self.sess)