gnimuc / lbfgsb.jl Goto Github PK
View Code? Open in Web Editor NEWJulia wrapper for L-BFGS-B Nonlinear Optimization Code
License: MIT License
Julia wrapper for L-BFGS-B Nonlinear Optimization Code
License: MIT License
The underlying Fortran code still prints messages regardless of iprint
, which clogs up stdout pretty quickly in my case. This could be fixed fairly quickly by adding an if statement to lines 3282-3283 in lbfgsb.f
:
write(6,*) ' Positive dir derivative in projection '
write(6,*) ' Using the backtracking step '
If this package uses the C version, the fix is detailed here. I'm not sure how to do it myself since I am unfamiliar with the new dependency-building mechanism.
Thank you for wrapping the library. Such a lifesaver.
Someone in discourse.julialang.org mentioned that the lbfgsb.f used in scipy.optimize
is actually a 2011 modification of the original method, see: JuliaNLSolvers/Optim.jl#927.
There is https://github.com/JuliaBinaryWrappers/L_BFGS_B_jll.jl but it is not clear to me how you generated the .so binary.
Is it possible to know the loss/parameters in each step (rather than each function call).
Since the function and gradient evaluations occur always simultaneously, a function fg!
to compute both function and gradient would be more suitable for this software (or at least supported as an option). This is especially desirable if the function and gradient evaluations share some computations.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Just like what scipy did here:
Sometimes lbfgsb
will print info:
ascent direction in projection gd = 0.0000000000000000
even though I have set iprint
to -1
.
Hello,
I'm trying to use LBFGSB but get the following error when running the example Rosenbrock script. I'm using version 1.2.0 of Julia and the error message is as follows:
ERROR: LoadError: MethodError: no method matching (::L_BFGS_B)(::typeof(f), ::typeof(g!), ::Array{Float64,1}, ::Array{Float64,2}; m=5, factr=1.0e7, pgtol=1.0e-5, iprint=-1, maxfun=15000, maxiter=15000)
Closest candidates are:
L_BFGS_B(::Any, ::AbstractArray{T,1} where T, ::AbstractArray{T,2} where T; m, factr, pgtol, iprint, maxfun, maxiter) at /Users/lab_home/.julia/packages/LBFGSB/mGpSN/src/wrapper.jl:33
Stacktrace:
This is the same error I was getting when I attempted to write my own problem as well. Any feedback/suggestions that you can give are much appreciated.
CI keeps failing on AppVeyor, but I don't have a 32 bit Windows machine for debugging this issue for now:
https://ci.appveyor.com/project/Gnimuc/lbfgsb-jl/branch/master/job/43iwl8nm498eg57q
I've been successfully using LBFGSB on julia 1.0.2, but recently I tried to compile julia with MKL to compare performances (still julia 1.0.2). When I try to build LBFGSB, I get the following error (I just changed the username):
┌ Warning: Cannot make sense of autodetected libstdc++ ABI version ('3.4.0')
└ @ BinaryProvider ~/.julia/packages/BinaryProvider/4F5Hq/src/PlatformNames.jl:624
┌ Debug: Rejecting cache file /home/USERNAME/.julia/compiled/v1.0/BinaryProvider/ek6VZ.ji due to it containing an invalid cache header
└ @ Base loading.jl:1330
┌ Debug: Recompiling stale cache file /home/USERNAME/.julia/compiled/v1.0/BinaryProvider/ek6VZ.ji for BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232]
└ @ Base loading.jl:1190
┌ Warning: platform_key() is deprecated, use platform_key_abi() from now on
│ caller = ip:0x0
└ @ Core :-1
ERROR: LoadError: LibraryProduct(nothing, ["liblbfgsb"], :liblbfgsb, "Prefix(/home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/usr)") is not satisfied, cannot generate deps.jl!
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] #write_deps_file#152(::Bool, ::Function, ::String, ::Array{LibraryProduct,1}) at /home/USERNAME/.julia/packages/BinaryProvider/4F5Hq/src/Products.jl:414
[3] (::getfield(BinaryProvider, Symbol("#kw##write_deps_file")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(write_deps_file), ::String, ::Array{LibraryProduct,1}) at ./none:0
[4] top-level scope at none:0
[5] include at ./boot.jl:317 [inlined]
[6] include_relative(::Module, ::String) at ./loading.jl:1044
[7] include(::Module, ::String) at ./sysimg.jl:29
[8] include(::String) at ./client.jl:392
[9] top-level scope at none:0
in expression starting at /home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/build.jl:46
I'm not sure to understand what is happening and if the compilation with MKL is really the issue or not, but the library is present and can be opened:
julia> Libdl.open("/home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/usr/lib/liblbfgsb-3.so")
IOStream(<file /home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/usr/lib/liblbfgsb-3.so>)
Any hint?
[EDIT] Sorry, posted too quickly, I used open
and not dlopen
julia> Libdl.dlopen("/home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/usr/lib/liblbfgsb-3.so")
ERROR: could not load library "/home/USERNAME/.julia/packages/LBFGSB/sLXbo/deps/usr/lib/liblbfgsb-3.so"
libgfortran.so.4: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
So I guess this is a more general problem, probably not related directly to LBFGSB or MKL but just to the fact that julia was compiled from source…
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.