def initialize(self): # create save directory if os.path.exists(self.save_dir): eprint('Confirm removing {}\n[Y/n]'.format(self.save_dir)) if input() != 'Y': import sys sys.exit() import shutil shutil.rmtree(self.save_dir) eprint('Removed: ' + self.save_dir) os.makedirs(self.save_dir) # set deterministic random seed if self.random_seed is not None: reset_random(self.random_seed)
def initialize(cls, config): # create save directory if os.path.exists(config.save_dir): eprint('Confirm removing {}\n[Y/n]'.format(config.save_dir)) _input = input() if _input == 'Y': import shutil shutil.rmtree(config.save_dir) eprint('Removed: ' + config.save_dir) elif _input != 'n': import sys sys.exit() if not os.path.exists(config.save_dir): os.makedirs(config.save_dir) # set deterministic random seed if config.random_seed is not None: reset_random(config.random_seed)
def initialize(self): # arXiv 1509.09308 # a new class of fast algorithms for convolutional neural networks using Winograd's minimal filtering algorithms os.environ['TF_ENABLE_WINOGRAD_NONFUSED'] = '1' # create training directory if not self.restore: if os.path.exists(self.train_dir): eprint('Confirm removing {}\n[Y/n]'.format(self.train_dir)) if input() != 'Y': import sys sys.exit() import shutil shutil.rmtree(self.train_dir, ignore_errors=True) eprint('Removed: ' + self.train_dir) os.makedirs(self.train_dir) # set deterministic random seed if self.random_seed is not None: reset_random(self.random_seed)
def initialize(self): if not os.path.exists(self.output_dir): os.makedirs(self.output_dir) # set deterministic random seed if self.random_seed is not None: reset_random(self.random_seed)