Comments (3)
Yes, that is correct. Work has been stopping progress here, but I'll soon make another push.
from nlsolvers.jl.
btw, i'm using this package, Mainly for non linear solving, both linesearch and trust region methods (not optimization yet, but ready to use when necessary), and i found some things:
- retrieval of results of non linear systems are a little inconsistent. I found is that, the zeros of an
NEqProblem
using linesearch are stored inres.info.solution
, whereas the same results using a trust region approach are stored inres.info.zero
. i have a helper function to ease the access:
function x_sol(res::NLSolvers.ConvergenceInfo{<:NLSolvers.LineSearch, <:Any, <:NLSolvers.NEqOptions})
res.info.solution
end
function x_sol(res::NLSolvers.ConvergenceInfo{<:NLSolvers.TrustRegion, <:Any, <:NLSolvers.NEqOptions})
return res.info.zero
end
- i use AD with non linear systems, and the
jv!(x)
, and knowing thatForwardDiff.jl
doesn't implement such function, i used an implementation inSparseDiffTools.jl
:
struct DeivVecTag end
function jacvec!(dy, f, x, v,
cache1 = ForwardDiff.Dual{DeivVecTag}.(x, v),
cache2 = ForwardDiff.Dual{DeivVecTag}.(x, v))
cache1 .= Dual{DeivVecTag}.(x, v)
f(cache2,cache1)
dy .= partials.(cache2, 1)
end
function jacvec(f, x, v)
partials.(f(Dual{DeivVecTag}.(x, v)), 1)
end
#inside the auto AD of the NEqProblem, with f!(result, x) as input
function jv!(x)
function JacV(dy,v)
return jacvec!(dy,f!,x,v)
end
return LinearMap(JacV,length(x))
end
- Surprisinly, The non linear solving procedure is ForwardDiff-friendly. Ideally dispatching on
AbstractVector{<:Dual}
and definingfrule
s andrrules
could be further advancing on that regard, but the status quo is favorable, as i can't use reverse mode AD with the functions i'm working with.
as always, great work!
from nlsolvers.jl.
retrieval of results of non linear systems are a little inconsistent. I found is that, the zeros of an
NEqProblem
using linesearch are stored inres.info.solution
, whereas the same results using a trust region approach are stored inres.info.zero
. i have a helper function to ease the access:
Good point. Ideally it should be retrieved using a solution_candidate
function or similar. (edit: solution_candidate is not a good name as this just means it's a feasible iterate...)
. i use AD with non linear systems, and the `jv!(x)`, and knowing that `ForwardDiff.jl` doesn't implement such function, i used an implementation in `SparseDiffTools.jl`:
I suppose you mean that you're using the krylov methods? Yes that interface is not really polished. Happy to improve here.
1. Surprisinly, The non linear solving procedure is ForwardDiff-friendly. Ideally dispatching on `AbstractVector{<:Dual}` and defining `frule`s and `rrules` could be further advancing on that regard, but the status quo is favorable, as i can't use reverse mode AD with the functions i'm working with.
You mean that you've successfully nested your solve in some outer function that you use ForwardDiff on? That's good to hear. Would maybe be a good idea to test that. I am not too familiar with the frules and rrules setup, but it seems like the community is going in that direction, so I'm all for it!
Thanks for taking this for a spin. I hope to spend some time on it very soon
from nlsolvers.jl.
Related Issues (20)
- NEqProblem fails with BFGS and LBFGS HOT 1
- ProjectedNewton
- TrustRegion(Newton,NWI()) fails with BigFloat input HOT 1
- ActiveBox fails when reaching maximum number of iterations HOT 8
- Base.summary on Newton with custom linsolve just shows the type
- Setup with LinearSolve.jl HOT 1
- Accept systems of equations given as multidimensional arrays? HOT 1
- TagBot trigger issue HOT 7
- make documentation of problem types, objectives and methods available on the web docs
- `BrentMin` returns a tuple instead of a `ConvergenceInfo` object HOT 1
- define `upto_gradient` for `MeritObjective` HOT 1
- DFSANE tolerances are hardcoded HOT 1
- Improve BrentMin edge handling
- add `f_abstol` convergence measures for NEqProblem HOT 2
- `NLSolvers.converged(ci::ConvergenceInfo)`
- t0 not defined in Anderson HOT 1
- Anderson does not use relaxation factor HOT 1
- Should evaluators (upto_g, etc) return objective objects?
- Should there be extensions for threadsx and distributed for batch_f?
- Preconditioner should be in objective
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 nlsolvers.jl.