Line search method of scipy optimize minimize function - optimization

I am conducting research on optimization using scipy library, and have a question regarding with default line search method implemented in this library. I would like to write a description of the optimization method including what kind of line search method was applied. I run the optimization code using default options (BFGS) with unconstrained nonlinear objective function. Anyone who knows if scipy minimize function uses wolfe line search as a default? Thanks in advance!

Looking at the source code reveals that they use the _line_search_wolfe12 function. So yes, it uses Wolfe line search.

Related

how to solve a determinant in symengine (python) explicitely with the berkovitz algorithm

I would like to replace an existing sympy code with symengine and I would need to replace the determinant calculation (method=berkovitz) with symengine. Is it possible to select this method explicitely with symengine in python? I saw it in the c++ code but I do not know how to use it in the python environment. I am using the latest symengine version (v0.9.2).
I looked into the testcases for matrices but could not find an example. I just wonder because the method is mentioned in the c++ code of symengine and I thought it should also work from python.
Thanks for any hint.

Gurobi options in GAMS

I've recently moved to Gurobi and we use GAMS.
Have been struggling to implement Gurobi options, is there a way to use Gurobi options directly? With a file or something like that.
For instance, I want to use the following options and have not found a GAMS correspondence:
Scaleflag;
MIPFocus;
Thank you in advance,

Acess the SDPA-GMP solver from mpmath

I do have code in mpmath that does the main part of what i do, except soling a semidefinite programming in arbitrary precision.
For that, i might be able to use SDPA-GMP, a C++ piece of software that solves a SDP in arbitrary precision using GMP as base arbitrary precision library.
Do you know if there are possibilities to call this from python ? On the over hand, is there somewhere a converter that passed from mpmath objcts to gmp ?
You might have found a solution but here is one: you can use the interface PICOS, save the problem with the extension 'dat-s' and then feed that to SDPA-GMP. This works perfectly and it's rather easy to use.

What level do LLVM optimization passes need to work on?

I have been exploring LLVM Optimizations recently but have a small question:
How do we know that a built-in pass (not LLVM Passes that we write) can be applied at the function level (using a FunctionPassManager), or Module level, etc?
Example - As seen in the KaleidoScope tutorial 4:
TheFPM->add(createCFGSimplificationPass());
This one is fairly obvious that it should be at function level but what about other passes? Are they all meant to work at any level (BasicBlock, Function, Module, etc) correctly?
I think you can find that out by looking at the source code.
For example, here is code for SimplifyCFGPass which inherites FunctionPass and here is the source code for MemoryDependencyAnalysisPass and as you can see it's a function level pass.

User-specified function in mpfit

I have been an IDL programmer for sometime now and looking to transition to Python. I find that MPFIT's IDL version exists in Python. However, I am looking for MPFITFUN version in Python (http://www.physics.wisc.edu/~craigm/idl/down/mpfitfun.pro) or something similar.
Basically, I am looking for a Python function that takes a user-defined function and uses like Levenberg-Marquardt least-squared fit (like MPFIT).
Thanks,
There are fitting functions built into SciPy but I do not know of any which account for uncertainties in data as MPFITFUN does.
I have found Sherpa to be an excellent modeling and fitting package for Python which accounts for uncertainties and replaces MPFITFUN: http://cxc.harvard.edu/contrib/sherpa/
Since Sherpa is produced by astronomers it has a lot of built in astrophysical models, but you can build your own function to fit with Sherpa's Levenberg-Marquardt, Nelder-Mead or Monte Carlo algorithms. I used the template from the pysherpa blog:
http://pysherpa.blogspot.com/2010/06/user-defined-sherpa-model-types-using.html
mpfit.py is available from https://code.google.com/p/astrolibpy/ and an older version hosted at http://cars.uchicago.edu/software/python/mpfit.html.
A good alternative is lmfit: https://pypi.python.org/pypi/lmfit/, https://github.com/lmfit/lmfit-py, http://lmfit.github.io//lmfit-py/
I accidentally found that there also exists the MPFITEXPR in Python. Here's the link to the code. You can also download it via Astrolibpy project.
Link:
https://code.google.com/p/astrolibpy/source/browse/mpfit/mpfitexpr.py?r=3545675a0662392e3e09c88beaf275c9e7881cf6