Comments (7)
This bug has been verified; see
https://github.com/coin-or/CppAD/blob/master/bug/cond_exp.sh
from cppad.
I have added a temporary (undocumented) feature
f.optimize("no_conditional_skip")
should work with the case above. This is a temporary fix that is necessary when the base type can correspond to variables. A better solution (which does automatic detection of this variability for each conditional expression) will be added to the wish list.
from cppad.
Thank you!
This fixes the issue as long as people remember to use this option.
Would it be possible to define default behavior for specific data types?
Some like this:
template<class Base>
struct CppADOptimizationOptions {
static inline bool multiLevelADType() {
return false;
}
// more option related methods here
};
template<>
template<class Base>
struct CppADOptimizationOptions<CppAD::AD<Base> > {
static inline bool multiLevelADType() {
return true;
}
};
from cppad.
In the long term, I plan to add information to the tape that informs the
optimizer when a variables base type value is IdenticalPar
http://www.coin-or.org/CppAD/Doc/base_identical.xml#Identical.IdenticalPar
Even in the multilevel AD case, there can be conditional comparisons
that can be skipped (once this information is available on the tape). I
will not be able to work on this for a few months.
For this reason, I have not made
f.optimize("no_conditional_skip")
part of the CppAD API. If the plan above works, at this point I plan to
remove the option (with a message that explains it is no longer necessary).
Brad.
On 3/2/2015 3:13 AM, João Rui Leal wrote:
Thank you!
This fixes the issue as long as people remember to use this option.
Would it be possible to define default behavior for specific data types?
Some like this:|template
struct CppADOptimizationOptions {
static inline bool multiLevelADType() {
return false;
}
// more option related methods here
};template<>
template
struct CppADOptimizationOptionsCppAD::AD {
static inline bool multiLevelADType() {
return true;
}
};
|—
Reply to this email directly or view it on GitHub
#7 (comment).
from cppad.
I think that I have fixed this issue with the following commit
b564688
and it is not longer necessary to use the
f.optimize("no_conditional_skip")
option. The complication was the difference between parameters and variables at the AD and Base levels. The doxygen documentation for
https://github.com/coin-or/CppAD/blob/master/cppad/local/cskip_op.hpp
discusses this issue.
from cppad.
Thank you!
I tested with CppADCodegen and it works fine without the
"no_conditional_skip" argument.
2015-05-27 6:57 GMT+01:00 Brad Bell [email protected]:
—
Reply to this email directly or view it on GitHub
#7 (comment).
from cppad.
This issue has been fixed.
from cppad.
Related Issues (20)
- Computing the Jacobian of an ODE HOT 2
- CPPAD_DISCRETE_FUNCTION does not work through base2ad HOT 2
- Eigen::NumTraits does not define infinity() or quiet_NaN() HOT 3
- How to add self defined functions to AD<Base>? HOT 8
- Using C++ conditional operators HOT 5
- AD<double> not working in Eigen with some complex function HOT 4
- Computing Derivatives of solutions of optimization Problems HOT 9
- Working with CppAD::ipopt::solve and CppADCodeGen HOT 4
- Leppov case missing in local/optimize/get_op_usage.hpp HOT 3
- Discrete coefficient sets for polynomial vary as a function of dependent variable HOT 16
- How to write the `.lp` file of a Ipopt model? HOT 6
- Linking error "undefined reference to `CppAD::local::temp_file()'" HOT 4
- solution vector is empty HOT 10
- Undefined reference to temp_file HOT 2
- ipopt and cppad tests HOT 11
- Problem to Link with CppAD and Ipopt HOT 16
- CppAD::cg::CGException: what(): GreaterThanZero cannot be called for non-parameters HOT 5
- Compiler warnings from use of bitwise '|' and '&' for bool arguments HOT 5
- Potential build mistake in third party tool in use of NDEBUG flag - CppAD compiled in Release HOT 13
- Static library for non-windows builds 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 cppad.