Comments (4)
Well this does not fully answer my question but I shall dig in the code a little more and come back to you with a clearer idea.
Thanks a lot anyway !
from ifopt.
Hi!
In the end, the cost always has to be scalar, that's just the way nonlinear programming problems are defined. This cost however can be composed of a variety of scalar cost-terms. You can subtract a scalar cost term by defining the costs as negative.
The image shows the scalar cost J(x), and the gradient of this cost w.r.t x, which are two added 1xn row vectors (n being the number of optimization variables). Does that clear things up?
from ifopt.
Thanks for the (very) quick answer !
From a theoretical point of view we're on the same page. My question however was more from a programming point of view.
Using the same example as before, say I would like to do this vector subtraction (or whatever the operation) all at once. To benefit from vectorization, because the operation is heavy, well whatever the reason... How could one somewhat 'pre-compute' the error (in its vector form) to later on 'distribute' each scalar cost-term ? Or how to 'group' this variety of CostTerm
objects so that the operation is computed only once ?
I'm not sure this comment make things clearer, hopefully.
from ifopt.
So I guess I would simply implement this as one cost term, and then exploit Eigen efficiency to calculate the cost e.g. as
VectorXd x0 = var_set0->GetValues();
VectorXd x1 = var_set1->GetValues();
double cost = (x0 - x1).norm(); // Eigen will do this in the fastest way possible I assume
from ifopt.
Related Issues (20)
- Redundant calls to FillJacobianBlock HOT 11
- Unit tests are broken HOT 1
- ROS 2 Foxy Release? HOT 10
- Question about warm starting HOT 3
- warm start is not supported?
- Request release of latest on ROS Noetic? HOT 3
- The EvaluateCostFunctionGradient numerical difference produces incorrect gradient when using squared cost. HOT 3
- Project status
- ifopt-config.cmake error on Windows HOT 1
- defining equaility constraints
- errors with Snopt 7.7 HOT 2
- Get Iterations History HOT 1
- Internal representation of optimization variables HOT 8
- GetBounds() violation when both boundaries are negative HOT 3
- [Q] Weak solver performance HOT 8
- Using AD Libraries HOT 1
- Is IFOPT thread-safe?
- bad-free error when building with memory sanitizer flag
- Disabling solution summary. HOT 1
- I have add a GetHession function to this library. Does anyone know how I should submit to the library owner 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 ifopt.