當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。