예제 #1
0
 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)
예제 #2
0
파일: driver.py 프로젝트: papayafp/MAIRL
 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))
예제 #3
0
    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)
예제 #4
0
 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))
예제 #5
0
파일: driver.py 프로젝트: kiminh/Buffe
 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)
예제 #6
0
 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))
예제 #7
0
 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)