本文整理汇总了Python中util.get_generator_conditioning方法的典型用法代码示例。如果您正苦于以下问题:Python util.get_generator_conditioning方法的具体用法?Python util.get_generator_conditioning怎么用?Python util.get_generator_conditioning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util.get_generator_conditioning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_generated_data
# 需要导入模块: import util [as 别名]
# 或者: from util import get_generator_conditioning [as 别名]
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
"""Get generated images."""
noise = tf.random_normal([num_images_generated, 64])
# If conditional, generate class-specific images.
if conditional_eval:
conditioning = util.get_generator_conditioning(
num_images_generated, num_classes)
generator_inputs = (noise, conditioning)
generator_fn = networks.conditional_generator
else:
generator_inputs = noise
generator_fn = networks.generator
# In order for variables to load, use the same variable scope as in the
# train job.
with tf.variable_scope('Generator'):
data = generator_fn(generator_inputs)
return data
示例2: _get_generated_data
# 需要导入模块: import util [as 别名]
# 或者: from util import get_generator_conditioning [as 别名]
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
"""Get generated images."""
noise = tf.random_normal([num_images_generated, 64])
# If conditional, generate class-specific images.
if conditional_eval:
conditioning = util.get_generator_conditioning(
num_images_generated, num_classes)
generator_inputs = (noise, conditioning)
generator_fn = networks.conditional_generator
else:
generator_inputs = noise
generator_fn = networks.generator
# In order for variables to load, use the same variable scope as in the
# train job.
with tf.variable_scope('Generator'):
data = generator_fn(generator_inputs, is_training=False)
return data
示例3: test_get_generator_conditioning
# 需要导入模块: import util [as 别名]
# 或者: from util import get_generator_conditioning [as 别名]
def test_get_generator_conditioning(self):
conditioning = util.get_generator_conditioning(12, 4)
self.assertEqual([12, 4], conditioning.shape.as_list())