MCPcopy
hub / github.com/hanzhanggit/StackGAN / sampler

Method sampler

stageI/trainer.py:125–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

123 print("success")
124
125 def sampler(self):
126 c, _ = self.sample_encoded_context(self.embeddings)
127 if cfg.TRAIN.FLAG:
128 z = tf.zeros([self.batch_size, cfg.Z_DIM]) # Expect similar BGs
129 else:
130 z = tf.random_normal([self.batch_size, cfg.Z_DIM])
131 self.fake_images = self.model.get_generator(tf.concat(1, [c, z]))
132
133 def compute_losses(self, images, wrong_images, fake_images, embeddings):
134 real_logit = self.model.get_discriminator(images, embeddings)

Callers 1

init_optMethod · 0.95

Calls 2

get_generatorMethod · 0.45

Tested by

no test coverage detected