python优化异步管道。
POA的Python项目详细描述
poap:使用异步并行进行优化的管道
poap为构建和 结合异步优化策略。典型的 用poap编写的优化代码可能如下所示:
frompoap.strategyimportFixedSampleStrategyfrompoap.strategyimportCheckWorkStrategyfrompoap.controllerimportThreadControllerfrompoap.controllerimportBasicWorkerThread# samples = list of sample points ...controller=ThreadController()sampler=FixedSampleStrategy(samples)controller.strategy=CheckWorkerStrategy(controller,sampler)foriinrange(NUM_WORKERS):t=BasicWorkerThread(controller,objective)controller.launch_worker(t)result=controller.run()print'Best result: {0} at {1}'.format(result.value,result.params)
基本成分是一个能够要求工人 运行函数评估和选择采样位置的策略。 策略发送控制器建议的操作,其中 然后控制器接受或拒绝;控制器依次通知 通过回调函数实现相关事件的策略。
大多数用户可能希望提供他们自己的策略, 控制器,或两者。