Optimization modelling language with support of complex variables - optimization

I am looking for optimization modelling libraries in python like CVXPY and Pyomo with support of complex variables (variables with real and imaginary part) and non-linear problems. CVXPY support complex variables but doesn't support nonlinear function for constraints. On the other hand, Pyomo can support nonlinear problems but doesn't support complex variables.
In conclusion: I am working on a large scale nonlinear and nonconvex optimization problem with some comlex variables and I am looking for something like cvxpy for these types of problems.
Any suggestions!
Thanks

Related

How to learn and understand the pattern matching function for XLA?

I am learning XLA recently. XLA (Accelerated Linear Algebra) is a domain-specific compiler for linear algebra that can accelerate TensorFlow models with potentially no source code changes. Due to the lack of document, it is hard to learn some components systematically.
I am trying to understand the matcher such as [m::MaximumAnyOrder][1], m::Broadcast.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/gpu/cudnn_fused_conv_rewriter.cc#L607-L608
But I didn't the the function definition or document on these APIs. It seems they are not in the codebase of XLA.
Any experts can help me how to find the API definition or document to better understand how they work?

Optimization of data-driven function as Tensorflow model

I try to find the optimum of a data-driven function represented as a Tensorflow model.
Means I trained a model to approximate a function and now want to find the optimum of this approximated function using a algorithm and software package/python library like ipopt, ipyopt, casadi, .... Or is there a possibility to do this directly in Tensorflow. I also have to define constraints, so I can't just use simple autodiff to do gradient decent and optimize my input.
Is there any idea how to realize this in an efficient way?
Maybe this image visualizes my problem to better understand what I'm looking for.

Commercial solvers with Gekko?

Is it possible to use commercially available solvers such as Gurobi, CPLEX or Mosek with Gekko? If yes, could anyone give a small example showing how to do it?
Thanks.
The solvers that you referenced are for linear, mixed-integer linear, quadratic, mixed-integer quadratic, and quadratically constrained problems. There is no current interface because they can't solve the full range of problems that are required by Gekko such as Nonlinear Programming (NLP) and Mixed-Integer Nonlinear Programming (MINLP). MINLP solvers such as APOPT can solve LP, QP, and MILP problems but it isn't as fast as Gurobi or CPLEX for MILP problems. It is possible to link new solvers to Gekko and there are several proprietary solvers linked that require a license to activate. Gurobi and CPLEX both have Python APIs so I recommend those if you are interested in using them with Python. More information on publicly available solvers is available in the APMonitor documentation.

Accuracy of solutions of differential equations with DeepXDE

We used DeepXDE for solving differential equations. (DeepXDE is a framework for solving differential equations, based on TensorFlow). It works fine, but the accuracy of the solution is limited, and optimizing the meta-parameters did not help. Is this limitation a well-known problem? How the accuracy of solutions can be increased? We used the Adam-optimizer; are there optimizers that are more suitable for numerical problems, if high precision is needed?
(I think the problem is not specific for some concrete equation, but if needed I add an example.)
There are actually some methods that could increase the accuracy of the model:
Random Resampling
Residual Adaptive Refinement (RAR): https://arxiv.org/pdf/1907.04502.pdf
They even have an implemented example in their github repository:
https://github.com/lululxvi/deepxde/blob/master/examples/Burgers_RAR.py
Also, You could try using a different architecture such as Multi-Scale Fourier NNs. They seem to outperform PINNs, in cases where the solution contains lots of "spikes".

Scipy and pulp which will be better if using cplex solver

Which among python libraries like pulp and Scipy , has the capability to work with Cplex solver .If we have huge constraints and datasets for optimisation in supply chain .
PuLP is explicitly designed to model (and solve) LPs and it has bindings to use CPLEX under the hood.
You can also use Scipy with CPLEX, just not directly: you can organize your data in scipy and when it comes to creating constraints you can construct them from the data stored in scipy data structures.