[SciPy-dev] connecting tnc 1.3
dmitrey
openopt@ukr....
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)
>>
>> D.
>>
>> _______________________________________________
>> Scipy-dev mailing list
>> Scipy-dev@scipy.org
>>
>>
>
>
>> http://projects.scipy.org/mailman/listinfo/scipy-dev
>>
>>
> Dmitrey,
>
> scipy.test(1) results in one error connected with tnc
>
> ======================================================================
> ERROR: test_tnc (scipy.tests.test_optimize.test_tnc)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File
> "/usr/lib64/python2.4/site-packages/scipy/optimize/tests/test_optimize.py
> ", line 220, in test_tnc
> err = "Failed optimization of %s.\n" \
> TypeError: list objects are unhashable
>
> Nils
>
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
>
>
>
>Dmitrey,
>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
test fails.
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.
Regards, D.
More information about the Scipy-dev
mailing list