当前位置: 首页>>代码示例>>Python>>正文


Python tflib.inception_score方法代码示例

本文整理汇总了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 
开发者ID:igul222,项目名称:improved_wgan_training,代码行数:12,代码来源:gan_cifar.py

示例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)) 
开发者ID:igul222,项目名称:improved_wgan_training,代码行数:10,代码来源:gan_cifar_resnet.py

示例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 
开发者ID:caogang,项目名称:wgan-gp,代码行数:17,代码来源:gan_cifar10.py

示例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 
开发者ID:YuguangTong,项目名称:improved_wgan_training,代码行数:12,代码来源:gan_cifar.py


注:本文中的tflib.inception_score方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。