[SciPy-dev] Abstract vectors in optimization

Robert Kern robert.kern@gmail....
Tue Jan 6 00:52:36 CST 2009


On Tue, Jan 6, 2009 at 00:06, David Cournapeau
<david@ar.media.kyoto-u.ac.jp> wrote:
> Robert Kern wrote:
>> On Mon, Jan 5, 2009 at 23:27, David Cournapeau
>> <david@ar.media.kyoto-u.ac.jp> wrote:
>>> I want to ask: why would you *not* want to use numpy ? What does it
>>> bring to you ?
>>
>> If you want to implement optimization in a curved space with a
>> non-Euclidean metric (say in the space of correlation matrices or
>> SO(3)), you usually can't just use numpy arrays in the optimization
>> implementations that we have. You really do need to rewrite the
>> algorithm in terms of the abstract operations. For example,
>>
>> http://www-math.mit.edu/~lippert/sgmin.html
>
> Sure, I did not mean more abstract are never useful, I understood the op
> question as why not writing the whole scipy without numpy. For more
> specific algorithms, I don't see much difference between "abstract
> arrays" for optimization and another kind of classes - unless you need
> the whole numpy interface and linear algebra ?

Not everything, but you do need to change code (even the pure Python
functions) in order to actually be black-box and support other
metrics. There are Euclidean/ndarray assumptions in the code. For
example, I initially thought that the iterative FORTRAN solvers that
we have was already black-box enough, but after asking Lippert's
advice you need a bit more. The iterative solvers are abstracted at
roughly the level an ndarray-like class would be.

> P.S: Thanks for the link, BTW, I did not know about this work, it looks
> quite interesting; did you implement some of the methods mentioned in
> the paper "Nonlinear Eigenvalue Problems With Orthogonality Constraints
> <http://www-math.mit.edu/%7Elippert/research/sgchapter.ps.gz>" ?

Some. It was at the stage of using the scipy.sparse.linalg iterative
solvers before I realized that they weren't sufficient. Also, this was
some time ago, and the interfaces changed a bit, so it currently
doesn't even almost work. It follows the work done in LRCM MIN for
finding low-rank correlation matrices, which is a derivative of SG
MIN.

  http://pietersz.org/lrcm%20min.htm

In order to make it work, the iterative solvers actually need to be
re-implemented.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cholesky_optimize.py
Type: text/x-python-script
Size: 22162 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20090106/787eb8f2/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: randcorr.py
Type: text/x-python-script
Size: 1524 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20090106/787eb8f2/attachment-0003.bin 


More information about the Scipy-dev mailing list