Comments (2)
Hello @desal , thank you so much for your interest in adopting PRIMA in dlib, and for raising your concern.
Apologies for my long-delayed response.
A short answer to your question: PRIMA pays more attention to reducing the number of function evaluations and improving the code clarity & simplicity, even if this is at the cost of more flop taken inside the solvers.
Why is this reasonable? PRIMA is designed as a package for derivative-free optimization problems, where the cost is dominated by function evaluations, not the flop inside the solvers. In these problems, each function evaluation may take several minutes, hours, or days, and hence it makes little sense to care about how to save the flop and reduce the internal computational time by several milliseconds per iteration.
Of course, this does not mean that PRIMA does not care about the internal cost of solvers. This just means that there is a priority:
Reducing number of function evaluations >> improving code simplicity & clarity >> saving internal cost of solvers.
In your test, as you measured, each function evaluation takes an extremely short time. Therefore, the computing time is dominated by the internal cost of the solvers. However, this is normally not the case in practice --- or I should say, PRIMA is not designed for such a situation.
If your interest is to solve problems where the function evaluation is cheap, then Powell's solver may not be the correct choice. If you decide to adopt Powell's solvers while concerned about the internal cost of the solvers, then there are two possibilities.
- Stay with the original F77 implementation (or its C translation) of the solvers, tolerating the fact that they are impossible to maintain and contain bugs.
- Consider modifying PRIMA to utilize BLAS for the underlying matrix-verctor procedures (
matprod
,inprod
, etc; you only need to consider the procedures in fortran/common/linalg.f90). However, I am not sure whether such a version will be much more efficient (in terms of internal costs of the solvers) than the current one.
To elaborate things better, I have posted a discussion. I hope it is not too long to read (the length partially explains the delay). I will be very glad to see your comments there.
from prima.
Given the above comments, the results of your test are still a bit strange to me.
- What kind of flags did you provide to the compiler when compiling PRIMA?
- Did you by any chance set
PRIMA_DEBUGGING
to 1 infortran/common/ppf.h
? Such a setting will be expensive and should not be used in production.
from prima.
Related Issues (20)
- Mexification fails on macOS with Xcode 15 and Intel oneAPI 2023
- The C example on README does not work HOT 1
- cobyla fails CMake test with flang family compilers HOT 1
- Support Function Call Parallelization in MATLAB Interface HOT 1
- Support "OutputFcn" option in MATLAB interface HOT 2
- Enable reverse communication?
- LINCOA doesn't adhere to upper and lower bounds HOT 8
- BOBYQA recursion problem HOT 3
- Rhobeg and rhoend arrays HOT 1
- Improve the scaling
- `PRIMA_INTEGER_KIND` slightly affects the result when compiled with `-Ofast -fno-stack-arrays`
- The behavior of COBYLA is slightly different when `infnan_mod` is broken and the code is compiled with `-Ofast -fno-stack-arrays`
- Should `prima_get_rc_string` be exposed in the C public API? HOT 1
- CMake test fails with strict diagnostic options for Intel compilers HOT 3
- Add options.ctol to `prima_is_success` HOT 1
- `tracebackqq` in `matlab/mex_gateways/debug.F90` trigers a SEGFAULT when it is called HOT 1
- Get ` PRIMA_PROBLEM_SOLVER_MISMATCH_XXX` back
- Why the versions of OS and gcc in build_python.yml are old? HOT 2
- Python wheel testing fails on macOS 14 (ARM64)
- LINCOA in multiple threads odd results HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prima.