本文整理汇总了Python中pool.Pool.select方法的典型用法代码示例。如果您正苦于以下问题:Python Pool.select方法的具体用法?Python Pool.select怎么用?Python Pool.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pool.Pool
的用法示例。
在下文中一共展示了Pool.select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: P
# 需要导入模块: from pool import Pool [as 别名]
# 或者: from pool.Pool import select [as 别名]
# Active learning loop - at each stage save an image of the current interest functions...
# (Uses P(wrong), but plots both P(wrong) and P(new).)
print 'Doing active learning...'
p = ProgBar()
p.callback(0,limit)
conc_graph = []
conc_graph.append(visualise('%s/query_%s_%02i'%(out_dir, task, 0)))
for ii in xrange(1,limit+1):
p.callback(ii,limit)
# Select a sample and update the model...
pool.update(classifier)
sample, prob_dict, cat = pool.select(task)
classifier.add(sample, cat)
# Visualise the model after this many querys...
conc_graph.append(visualise('%s/query_%s_%02i'%(out_dir, task, ii)))
del p
# Save out the concentration graph, to indicate interest levels...
f = open('%s/conc_%s.csv'%(out_dir,task), 'w')
f.write('queries, new_interest\n')
for i,c in enumerate(conc_graph):
f.write('%i, %f\n'%(i,c))
f.close()