如何获得“一阶最优"?用python脚本 [英] How to get "first-order optimality" with python script

查看:159
本文介绍了如何获得“一阶最优"?用python脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇如何使用python脚本获得一阶最优"值. 为了优化,python有很多模块,例如scipy.optimize和openopt.但是我很困惑如何使用该模块来获得一阶最优性

I curious about how to get "first-order optimality" value using python script. For optimatization python has many module like scipy.optimize and openopt. But I confused how to use that module to get first-order optimality

这是用于获得一阶最优性的示例matlab脚本

This is sample matlab script to get first-order optimality

[x,resnorm,residual,exitflag,output,lambda]= lsqcurvefit(func,x0,xdata,tdata);
foo = output.firstorderopt %get first-order optimality value

这是mathworks的一些foo参考 此处

this is some of foo reference from mathworks here

感谢您的关注,2011年新年快乐:)

Thanks for your attention, Happy New Year 2011 :)

推荐答案

尝试 scipy.linalg.basic.lstsq scipy.optimize.minpack.curve_fit

尝试编写自己的代码,请参考教程,或者在网上搜索scipy.linalg.basic.lstsq以获取代码示例(那里有一些示例).如果遇到任何问题,请在此处发布代码和问题.

Try to write your own code, refer to the tutorials or else search the web for scipy.linalg.basic.lstsq for code samples (there are some out there). If you encounter any issues, post the code and the issue here.

这篇关于如何获得“一阶最优"?用python脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆