Logistic Regression
fminunc:自动学习率调整函数,具体见help
function [f,g] = myfun(x) f=(x(1)-5).^2+(x(2)-5).^2; g=zeros(2,1); g(1)=2*(x(1)-5); g(2)=2*(x(2)-5); clc;clear all;close all; options = optimset('GradObj','on','MaxIter',100); % indicate gradient is provided [a,b,c] = fminunc(@myfun,[0;0],options)

浙公网安备 33010602011771号