Coverage for hypergan/samplers/began_sampler.py : 22%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
BaseSampler.__init__(self, gan, samples_per_row) self.x_v = None self.z_v = None self.created = False
gan = self.gan config = gan.config sess = gan.session x_t = gan.inputs.x z_t = gan.encoder.sample if(not self.created): self.x_v, self.z_v = sess.run([x_t, z_t]) self.created=True g_t = gan.generator.sample rx_t = gan.discriminator.reconstruction rx_v, g_v = sess.run([rx_t, g_t], {x_t: self.x_v, z_t: self.z_v}) stacks = [] bs = gan.batch_size() // 2 width = self.samples_per_row stacks.append(self.x_v) stacks.append(rx_v) stacks.append(g_v)
#[print(np.shape(s)) for s in stacks] images = np.vstack(stacks) return { 'generator':images}
self.plot(images, path, save_samples) return [{'image': path, 'label': 'tiled x sample'}]
|