本文整理匯總了Python中pool.Pool.update方法的典型用法代碼示例。如果您正苦於以下問題:Python Pool.update方法的具體用法?Python Pool.update怎麽用?Python Pool.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pool.Pool
的用法示例。
在下文中一共展示了Pool.update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: P
# 需要導入模塊: from pool import Pool [as 別名]
# 或者: from pool.Pool import update [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))