zoukankan      html  css  js  c++  java
  • machine learning(11) -- classification: advanced optimization 去求cost function最小值的方法

    • 其它的比gradient descent快, 在某些场合得到广泛应用的求cost function的最小值的方法
    • when have a large machine learning problem,一般会使用这些advanced optimization algorithm而不是gradient descent

     Conjugate gradient, BFGS,L-BFGS很复杂,可以在不明白详细原理的情况下进行应用(使用software libary)。

     可以使用Octave和matlab的函数库直接进行应用,这些软件里面的build-in libarary已经很好的实现了这些算法。

     当要使用其它的语言来实现这些算法时,如c,c++,Java等,要确保你使用了good libary for implement these algorithms,因为不同的实现方法在性能上相差很大。

    • Example of using advanced optimizaion algorithmn in Octave

             

    1.   initialTheta的维度要>=2,initialTheta不能是一个real number(一维的).
    2. optimset是设置一些options
    3. GradObj, on 是指是否要计算gradient,on 指要计算
    4. MaxIter是指最大迭代数,100指最大迭代数为100
    5. initialTheta设置初始值为0
    6. [optTheta, functionVal, exitFlag]是指返回值,optTheta:求得最优解后theta的值;functionVal:最后costfuncion的值;exitFlag:表示迭代的过程是否收敛(1表示收敛,0不收敛)
    7. fminunc是Octave里面的一个advanced optimization函数
    8. @costFunction是指指向costFunction的指针
  • 相关阅读:
    转:android WebView 文字 、图片分开加载
    js获取网页高度
    [转]URLPath匹配原则
    Java课程设计俄罗斯方块
    Three Little Habits to Find Focus
    ubuntu 12.04 无法联网的问题
    [转]时间去了哪里
    matlab 用plot在图像上面画图
    深入理解ES6临时死区(Temporal Dead Zone)
    sql 连接超时问题
  • 原文地址:https://www.cnblogs.com/yan2015/p/4808850.html
Copyright © 2011-2022 走看看