tron优化器的python绑定
pytron的Python项目详细描述
啊!危险!
这是阿尔法质量的软件,仍然相当粗糙的边缘。 特别是错误管理仍然缺乏(这意味着 如果在优化过程中出了问题,就不会看到错误 信息,但只是垃圾)。这些事情正在解决,但是 我们还没到。
主要功能是pytron.minimize:
def minimize(func, grad_hess, x0, args=(), max_iter=1000, tol=1e-6): Parameters ---------- func : callable func(w, *args) is the evaluation of the function at w, It should return a float. grad_hess: callable returns the gradient and a callable with the hessian times an arbitrary vector. tol: float stopping criterion. XXX TODO. what is the stopping criterion ? Returns ------- w : array
停止标准
当它停止时,它就停止了。 达到。TOdo:添加公差
示例
代码
此软件使用了TRON optimization software(文件Src/Tr.{h,CPP})的C++实现。 从liblinear源(v1.93)分发,它是bsd许可的。 注意,最初的fortran tron实现(可用 here)未打开 源,但不在此项目中使用。
对原始代码的修改是:
- Do not initialize values to zero, allow arbitrary initializations
- Modify stopping criterion to comply with scipy.optimize API. Stop whenever gradient is smaller than a given quantity, specified in the gtol argument
- Return the gradient from TRON::tron (pass by reference)
- Add tol option to TRON
- Rename eps to gtol.
- Use infinity norm as stopping criterion for gradient instead of L2.
待办事项
- return status from TRON::TRON
- callback argument
参考文献
如果您使用该软件,请考虑引用下面的一些参考资料。
这一方法在“牛顿法 “有界约束优化问题”,Chih Jen Lin和Jorge J.Moré (http://epubs.siam.org/doi/abs/10.1137/S1052623498345075)
在“信任”一文中,还讨论了logistic回归的内容。 logistic回归的区域牛顿法”,林志仁,翁红宝石, Sathiya Keerthi先生(http://dl.acm.org/citation.cfm?id=1390703)
网站http://www.mcs.anl.gov/~more/tron/包含对此的引用 实现,尽管到软件的链接似乎是 破碎(2013年5月)。
许可证
此代码是根据BSD许可的条款授权的。参见文件复制 更多细节。
确认
的源代码