[SciPy-dev] connecting tnc 1.3
Tue Jul 24 08:31:07 CDT 2007
Nils Wagner wrote:
> dmitrey wrote:
>> so I commit the tnc 1.3 to svn (rev. 3185); the code related to the
>> problem mentioned (about lb-ub) I decided to implement in the following way:
>> if user pass bounds as (for example)
>> ((-1,1), (-1, None), None, (3,4))
>> then it means 3rd variable is unconstrained.
>> also I think ticket 384 (tnc:argument 2 must be python list, not
>> numpy.ndarray) is ready to be closed (scipy svn rev. 3186)
>> Scipy-dev mailing list
> scipy.test(1) results in one error connected with tnc
> ERROR: test_tnc (scipy.tests.test_optimize.test_tnc)
> Traceback (most recent call last):
> ", line 220, in test_tnc
> err = "Failed optimization of %s.\n" \
> TypeError: list objects are unhashable
> Scipy-dev mailing list
>You have also reverted the order of the output of optimize.fmin_tnc
>Now it returns (rc, nfeval, x).
>It was x, nfeval, rc before. Is this wanted ?
Afaik Robert Kern or someone else had mentioned the problem, but I
forgot to check the one.
C-compiled tnc module returns the values (x, funevals, rc) in revert order.
I have fix this in svn.
About failing tests:
So I see that test38fg returns
x: array([ 0.99327293, 0.98673917, 1.00557938, 1.01114086])
y: array([ 1., 1., 1., 1.])
since they differs more than numpy.assert_array_almost_equal allows, tnc
in scipy.sandbox.newoptimize there is only check for ||f_final - f_opt||
<=1e-8, that's why all test in tnc.py run successfully (and I didn't
know that something related to tnc fails). So now I decided just remove
check for ||x_final-x_opt|| (I will commit it some minuties later). On
the one hand, having ||f_final - f_opt|| is enough - we don't care how
far will x_final be from x_opt, if our objfunc values differ very small.
On the other, it should be checked that all constraints are ok in
x_final. So I think in future, maybe, it's worth to have additional
checks added to scipy.optimize tests, that will check is solution
feasible or not (but since it will take too much time (for all those
fmin_cobyla, l_bfgs_b, tnc), I can't provide it now).
>I have some trouble with fmin_ncg.
Ok, I will take a look now.
afaik scipy tests pass the fmin_ncg ok.
More information about the Scipy-dev