args=(data, y, sigmoid_cache, self.tau), maxiter=iters)else:# BFGS gives me a numerical problems with the dataset ../datasets/logreg/ex2data1.txt# ret = opt.fmin_bfgs(error, theta0, gradient,# args=(data, y, sigmoid_cache), maxiter=iters)# this worksret = opt.fmin_ncg(error, t...
# 需要导入模块: from scipy import optimize [as 别名]# 或者: from scipy.optimize importfmin_ncg[as 别名]deftest_ncg_hess(self, use_wrapper=False):""" Newton conjugate gradient with Hessian """ifuse_wrapper: opts = {'maxiter': self.maxiter,'disp':False,'return_all':False} retval = opt...