本文整理汇总了Python中tflib.inception_score方法的典型用法代码示例。如果您正苦于以下问题:Python tflib.inception_score方法的具体用法?Python tflib.inception_score怎么用?Python tflib.inception_score使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tflib
的用法示例。
在下文中一共展示了tflib.inception_score方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_inception_score
# 需要导入模块: import tflib [as 别名]
# 或者: from tflib import inception_score [as 别名]
def get_inception_score():
all_samples = []
for i in xrange(10):
all_samples.append(session.run(samples_100))
all_samples = np.concatenate(all_samples, axis=0)
all_samples = ((all_samples+1.)*(255./2)).astype('int32')
all_samples = all_samples.reshape((-1, 3, 32, 32)).transpose(0,2,3,1)
return lib.inception_score.get_inception_score(list(all_samples))
# Dataset iterators
示例2: get_inception_score
# 需要导入模块: import tflib [as 别名]
# 或者: from tflib import inception_score [as 别名]
def get_inception_score(n):
all_samples = []
for i in xrange(n/100):
all_samples.append(session.run(samples_100))
all_samples = np.concatenate(all_samples, axis=0)
all_samples = ((all_samples+1.)*(255.99/2)).astype('int32')
all_samples = all_samples.reshape((-1, 3, 32, 32)).transpose(0,2,3,1)
return lib.inception_score.get_inception_score(list(all_samples))
示例3: get_inception_score
# 需要导入模块: import tflib [as 别名]
# 或者: from tflib import inception_score [as 别名]
def get_inception_score(G, ):
all_samples = []
for i in xrange(10):
samples_100 = torch.randn(100, 128)
if use_cuda:
samples_100 = samples_100.cuda(gpu)
samples_100 = autograd.Variable(samples_100, volatile=True)
all_samples.append(G(samples_100).cpu().data.numpy())
all_samples = np.concatenate(all_samples, axis=0)
all_samples = np.multiply(np.add(np.multiply(all_samples, 0.5), 0.5), 255).astype('int32')
all_samples = all_samples.reshape((-1, 3, 32, 32)).transpose(0, 2, 3, 1)
return lib.inception_score.get_inception_score(list(all_samples))
# Dataset iterator
示例4: get_inception_score
# 需要导入模块: import tflib [as 别名]
# 或者: from tflib import inception_score [as 别名]
def get_inception_score():
all_samples = []
for i in range(10):
all_samples.append(session.run(samples_100))
all_samples = np.concatenate(all_samples, axis=0)
all_samples = ((all_samples+1.)*(255./2)).astype('int32')
all_samples = all_samples.reshape((-1, 3, 32, 32)).transpose(0,2,3,1)
return lib.inception_score.get_inception_score(list(all_samples))
# Dataset iterators