当前位置: 首页>>代码示例>>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;未经允许,请勿转载。