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


Python Pool.methods方法代码示例

本文整理汇总了Python中pool.Pool.methods方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.methods方法的具体用法?Python Pool.methods怎么用?Python Pool.methods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pool.Pool的用法示例。


在下文中一共展示了Pool.methods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import methods [as 别名]

# Parameters...
limit = 64
out_dir = 'iris_results'
prec_cache = 'precision_iris.pickle'
width = 800
height = 200



# Fetch the task...
if len(sys.argv)<2: task = 'p_wrong_hard'
else:
  task = sys.argv[1]
  assert(task in Pool.methods())
  
  
# Load the dataset...
data = Iris1D()
print 'Loaded %i examples'%data.getVectors().shape[0]



# Make the output directory, killing any previous versions...
try: shutil.rmtree(out_dir)
except: pass
os.makedirs(out_dir)


开发者ID:PeterZhouSZ,项目名称:helit,代码行数:29,代码来源:test_iris.py

示例2: drainAllPools

# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import methods [as 别名]
# Iterate the methods and run each through the classDiscover function, printing out stats...
def drainAllPools(train, test, methods, runs, base):
  for method in methods:
    print 'method = %s'%method
    p = ProgBar()
    aq, ak, at = drainPools(train, test, method, runs, p.callback)
    del p

    print 'Average # querys by # classes found:'
    for i, aqc in enumerate(aq):
      if i>1: print '  %i classes found: average of %.2f querys'%(i, aqc)
    print

    fn = '%s%s_p%i_r%i.csv'%(base,method,sum(map(lambda x: x[2], train)),runs)
    f = open(fn,'w')
    
    f.write('querys, classes, inlier\n')
    for i in xrange(len(ak)): f.write('%i, %f, %f\n'%(i, ak[i], at[i]))

    f.close()



# Run through the test sequence...
try: shutil.rmtree(out_dir)
except: pass
os.makedirs(out_dir)

drainAllPools(train, sampleWorld(test), Pool.methods(), runs, out_dir+'/')
开发者ID:PeterZhouSZ,项目名称:helit,代码行数:31,代码来源:test_synth.py


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