Giter VIP home page Giter VIP logo

lbfgs-lite's Introduction

LBFGS-Lite

A header-only L-BFGS unconstrained optimizer.

0. About

LBFGS-Lite is a C++ header-only library for unconstrained optimization. Many engineering considerations are added for improved robustness compared to the original version by Nocedal.

1. How to use

All explanations are detailed by the comments in "lbfgs.hpp". See "lbfgs_example.cpp" for the calling procedure. You may need to install Eigen via "sudo apt install libeigen3-dev" because we use Eigen for better performance since ver. 2.1. If you need a pure C-style lib without any external dependence, please refer to ver. 0.9.

2. Features

3. Why this lib

  • Our lib is well-organized and concise (about 800 lines).

  • Many other libs use Nocedal's zoom line search, More-Thuente line search, or Hager-Zhang line search. The truth is, interpolation-based schemes bring many tunable parameters and make more or less assumptions on the function smoothness. Engineering practice tells us that these assumptions can fail due to bad numerical conditions and ill-shaped functions. Admittedly, they slightly reduce the iteration number in some cases, but also easily-crashed.

  • Some other libs provide user-specified options for Armijo and weak/strong Wolfe condition without considering positive definiteness (PD) of the approximated Hessian. This is misleading because if only Armijo condition is satisfied, the PD property is not guaranteed and the solver is unstable or easily-crashed. We make the weak Wolfe condition mandatory here, which suffices for PD property.

  • We use Lewis-Overton line search as the only scheme since ver. 2.1 from which nonsmooth functions are supported. Other schemes either assume high orders of continuity, or enforce the strong Wolfe condition can never be fulfilled by nonsmooth functions. Moreover, Lewis-Overton line search are widely adopted in many graphics applications involving optimization on scene, shape, or mesh, showing its practical robustness.

  • According to our practice, the function/gradient evaluation numbers are comparable with interpolation-based schemes. Sometimes it even requires fewer function calls. If you insist an interpolation-one for smooth well-shaped cost function, we also propose our ver. 0.9 where a More-Thuente line search is kept.

  • Other schemes' global convergence on non-convex functions are not guaranteed theoretically. We avoid the potential problems by employing the cautious update scheme in our lib without additional computation overhead.

6. Licence

LBFGS-Lite is modified from the C version by Okazaki, which is further based on the original Fortran version by Nocedal. Thus it is distributed under the term of the MIT license according to previous ones by Okazaki and by Nocedal. Please refer to LICENSE file in the distribution.

7. Maintaince

If any bug, please contact Zhepei Wang ([email protected]).

lbfgs-lite's People

Contributors

zhepeiwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lbfgs-lite's Issues

-1007 error

Solver error is refining, the line search became smaller than mon step.
How to figure that out

why loop of i only has variable j

image
from line 1496 to line 1519, this two for loops has variable i, but in the loop body, there is no i, only j, why?
1496行到1519行这两个for循环是关于i的,但是循环体里面为什么只有j没有i?

Maximum feasible cost allowed after a optimisation step?

Hi,
thanks for this awesome work @ZhepeiWang
I am using ego-swarm-planner-v2 which uses lbfgs.hpp, I am not sure if it's related to this repo, but your help is much appreciated.

recently, when I was trying ego-swarm-planner-v2, I observed, the drone made a path with cost = 1794351201.188. and the generated path was not good and the drone started executing the path, I am curious, what's the maximum "feasible" cost I can allow?

below I have attached the image with cost and path

thanks and regards
imageedit_2_5660280720

-1008 error

a rounding error occurred. no line search step satisfy the sufficient decrease and curvature condition. How to fix it?

what is the purpose of using the parameter "loop"

in function lbfgs_optimize, there is a parameter "loop", howerver, after this parameter is set to zero, the loop will break, so why not just break directly, what is the purpose of the parameter "loop"
image

Optimisation timeout

Hi, @ZhepeiWang @bigsuperZZZX
I was wondering if there is a way to add a timeout to ensure we don't run the optimization more than a few ms or it may throttle other functions/ callbacks running. I am referring to the use of LBFGS-Lite in ego-swarm-planner-v2.

I have noticed that there are instances when the FSM callback is stuck in the optimization step.

thanks

what does the word "brackt" means in this project?

i can not understand what does the variable "brackt" means in this project。百度翻译说brackt是支架、括号的意思,我无法理解这个变量是干什么的,还有line_search_morethuente里面的stage变量,这两个变量是什么意思,支架和舞台?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.