Auto differentiation vs finite differences in optimization toolbox

3 ビュー (過去 30 日間)
acelaya0
acelaya0 2021 年 7 月 9 日
回答済み: Alan Weiss 2021 年 7 月 11 日
Is there a situation where finite differences is faster than automatic differentiation when using the "solve" function call in the optimization toolbox?
I'm using the optimization toolbox to solve an optimization problem with a complex loss funcation and relatively few optimization variables. I'm noticing a substantial speed up when changing the value of "ObjectiveDerivative" from "auto" to "finite-differences."
Any clarification would be greatly appreciated!

回答 (1 件)

Alan Weiss
Alan Weiss 2021 年 7 月 11 日
Yes, finite differences can be faster than AD. Typically, this occurs in situations like yours where the function or functions are complicated , and the resulting AD expressions are even more complex.
That said, sometimes you can help the solver by setting up your problem in a way that enables solve to operate efficiently. See Create Efficient Optimization Problems and, to a lesser extent for your problem, Separate Optimization Model from Data.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by