當前位置: 首頁>>代碼示例>>Python>>正文


Python score.score方法代碼示例

本文整理匯總了Python中score.score方法的典型用法代碼示例。如果您正苦於以下問題:Python score.score方法的具體用法?Python score.score怎麽用?Python score.score使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在score的用法示例。


在下文中一共展示了score.score方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_imagenet1k_resnet

# 需要導入模塊: import score [as 別名]
# 或者: from score import score [as 別名]
def test_imagenet1k_resnet(**kwargs):
    models = ['imagenet1k-resnet-50', 'imagenet1k-resnet-152']
    accs = [.77, .78]
    for (m, g) in zip(models, accs):
        acc = mx.metric.create('acc')
        (speed,) = score(model=m, data_val=VAL_DATA,
                         rgb_mean='0,0,0', metrics=acc, **kwargs)
        r = acc.get()[1]
        print('Tested %s, acc = %f, speed = %f img/sec' % (m, r, speed))
        assert r > g and r < g + .1 
開發者ID:ZiyueHuang,項目名稱:MXShuffleNet,代碼行數:12,代碼來源:test_score.py

示例2: test_imagenet1k_resnet

# 需要導入模塊: import score [as 別名]
# 或者: from score import score [as 別名]
def test_imagenet1k_resnet(**kwargs):
    models = ['imagenet1k-resnet-34',
              'imagenet1k-resnet-50',
              'imagenet1k-resnet-101',
              'imagenet1k-resnet-152']
    accs = [.72, .75, .765, .76]
    for (m, g) in zip(models, accs):
        acc = mx.metric.create('acc')
        (speed,) = score(model=m, data_val='data/val-5k-256.rec',
                         rgb_mean='0,0,0', metrics=acc, **kwargs)
        r = acc.get()[1]
        print('testing %s, acc = %f, speed = %f img/sec' % (m, r, speed))
        assert r > g and r < g + .1 
開發者ID:iFighting,項目名稱:Deep_Learning_In_Action,代碼行數:15,代碼來源:test_score.py

示例3: test_imagenet1k_inception_bn

# 需要導入模塊: import score [as 別名]
# 或者: from score import score [as 別名]
def test_imagenet1k_inception_bn(**kwargs):
    acc = mx.metric.create('acc')
    m = 'imagenet1k-inception-bn'
    g = 0.72
    (speed,) = score(model=m,
                     data_val='data/val-5k-256.rec',
                     rgb_mean='123.68,116.779,103.939', metrics=acc, **kwargs)
    r = acc.get()[1]
    print('Tested %s acc = %f, speed = %f img/sec' % (m, r, speed))
    assert r > g and r < g + .1 
開發者ID:iFighting,項目名稱:Deep_Learning_In_Action,代碼行數:12,代碼來源:test_score.py

示例4: test_imagenet1k_inception_bn

# 需要導入模塊: import score [as 別名]
# 或者: from score import score [as 別名]
def test_imagenet1k_inception_bn(**kwargs):
    acc = mx.metric.create('acc')
    m = 'imagenet1k-inception-bn'
    g = 0.75
    (speed,) = score(model=m,
                     data_val=VAL_DATA,
                     rgb_mean='123.68,116.779,103.939', metrics=acc, **kwargs)
    r = acc.get()[1]
    print('Tested %s acc = %f, speed = %f img/sec' % (m, r, speed))
    assert r > g and r < g + .1 
開發者ID:ZiyueHuang,項目名稱:MXShuffleNet,代碼行數:12,代碼來源:test_score.py

示例5: load_score

# 需要導入模塊: import score [as 別名]
# 或者: from score import score [as 別名]
def load_score(title):
    import asyncio
    from rank.util import purge
    from rank.collect.movie import get_comments
    loop = asyncio.get_event_loop()
    data = get_comments(title.strip())
    lines = ["| {0}".format(purge(comment)) for comment in data]

    logger.debug("Got comments")
    create = asyncio.create_subprocess_exec("vw", "-c", "-k", "-t", "-i", "data/raw.vw", "-p", "/dev/stdout", "--quiet",
                                            stdin=asyncio.subprocess.PIPE, stdout=asyncio.subprocess.PIPE)

    logger.debug("Creating classifier")
    proc = await create
    proc.stdin.write("\n".join(lines).encode("UTF-8"))
    await proc.stdin.drain()
    proc.stdin.close()
    result = await proc.stdout.read()
    await proc.wait()

    from score import score, parse_num

    logger.debug("Calculating score")
    ratings = [parse_num(line) for line in result.decode("UTF-8").split("\n")]
    for r, c in zip(ratings, data):
        logger.debug("Rating: {0}, Comment: {1}".format(r, c))
    mean = score(ratings[:-1], base=10)
    return True, str(mean) 
開發者ID:zaibacu,項目名稱:masters,代碼行數:30,代碼來源:api.py


注:本文中的score.score方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。