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


Python Pool.transition方法代碼示例

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


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

示例1: DataSetUtility

# 需要導入模塊: from pool import Pool [as 別名]
# 或者: from pool.Pool import transition [as 別名]
from transition import *

util = DataSetUtility(id_set_path)
pool = Pool(util)

# X's
x_oracle  = XOracle(util)
x_querier = XQuerier(pool)
x_learner = XLearner(pool)

# Y's
y_oracle  = YOracle(util)
y_querier = YQuerier(pool)
y_learner = YLearner(pool)

pool.transition = Transition(pool, x_querier, x_learner, y_querier, y_learner)

# initialize
x_seeds = x_oracle.get_seeds()
print 'INITIAL x_seeds', len(x_seeds)
pool.add_x(x_seeds)
print 'INITIAL x_data', len(pool.x_data)
print 'INITIAL x_hist', len(pool.x_hist)

y_seeds = y_querier.ask_seeds()
y_seeds_answered = y_oracle.answer(y_seeds)
pool.add_y(y_seeds_answered)
print 'INITIAL y_data', len(pool.y_data)
print 'INITIAL y_hist', len(pool.y_hist)
print 'INITIAL y_pred', len(pool.y_pred)
開發者ID:lookatmoon,項目名稱:doubleloop,代碼行數:32,代碼來源:scheduler.py


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