INNER CODE UNIT · Python
template
HyperGAN/HyperGAN · hypergan/cli.py:205
template = self.args.directory + config_format
print("[hypergan] Creating new configuration file '"+template+"' based off of '"+self.config_name+config_format)
if os.path.isfile(template):
raise ValidationException("File exists: " + template)
source_configuration = Configuration.find(self.config_name+config_format, config_format=config_format, prepackaged=True)
shutil.copyfile(source_configuration, template)
return
def run(self):
if self.method == 'train':
self.train()
elif self.method == 'build':
self.gan = hg.GAN(config=self.gan_config, inputs=self.create_input(blank=True))
if not self.gan.load(self.save_file):
raise ValidationException("Could not load model: "+ self.save_file)
self.build()
elif self.method == 'new':