INNER CODE UNIT · Python
sample
HyperGAN/HyperGAN · hypergan/cli.py:98
def sample(self, allow_save=True):
""" Samples to a file. Useful for visualizing the learning process.
If allow_save is False then saves will not be created.
Use with:
ffmpeg -i samples/grid-%06d.png -vcodec libx264 -crf 22 -threads 0 grid1-7.mp4
to create a video of the learning process.
"""
sample_file="samples/%s/%06d.png" % (self.config_name, self.samples)
self.create_path(sample_file)
self.lazy_create()
sample_list = self.sampler.sample(sample_file, allow_save and self.args.save_samples)
print("Devices D:")
for component in self.gan.discriminator_components():
print(component.device)