Comments (9)
@pkofod I just checked, and with the using
added above at the top is the full example.
But just to confirm to all: this is low priority. Would be nice to have it at some point in the future, but not sure I want to spend any time on this for a while.
from lecture-source-jl.
The issue is with this line of code which turns out of place functions into in-place functions. I think it's trying to put a DualNumber
in a Float64 array, which fails.
Will see how to patch. cc: @pkofod
from lecture-source-jl.
This should be a simple fix
from lecture-source-jl.
It may not be. I don't think it is that function which has issues, so much of how the F
is pre-allocated
It could require replacing a whole bunch of buffers inside of the underlying algorihtms to use similar
to x
instead of assuming they are reals vectors... or something like that.
This is low priority for sure.
from lecture-source-jl.
@pkofod Just ran JuliaNLSolvers/NLsolve.jl#188, and it didn't work. No worries, guess this is more complicated than I figured.
from lecture-source-jl.
Can I please get the full exampe?
from lecture-source-jl.
Code is same as above. Error is:
Arnav Sood@ARTS-ECON-ARNAV MINGW64 ~/desktop
$ julia adtest.jl
fp([0.1, 2.0]) = 2.2222222208
ERROR: LoadError: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2})
Closest candidates are:
Float64(::Real, !Matched::RoundingMode) where T<:AbstractFloat at rounding.jl:185
Float64(::T<:Number) where T<:Number at boot.jl:725
Float64(!Matched::Int8) at float.jl:60
...
Stacktrace:
[1] convert(::Type{Float64}, ::ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2}) at .\number.jl:7
[2] setindex!(::Array{Float64,1}, ::ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2}, ::Int64) at .\array.jl:769
[3] copyto! at .\abstractarray.jl:731 [inlined]
[4] copyto! at .\abstractarray.jl:723 [inlined]
[5] (::getfield(NLSolversBase, Symbol("#ff!#1")){getfield(NLsolve, Symbol("#g#22")){getfield(Main, Symbol("##3#4")){ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2}}}})(::Array{Float64,1}, ::SubArray{Float64,1,Array{Float64,2},Tuple{Base.Slice{Base.OneTo{Int64}},Int64},true}) at C:\Users\Arnav Sood\.julia\packages\NLSolversBase\ylZ0n\src\objective_types\inplace_factory.jl:11
[6] value!!(::OnceDifferentiable{Array{Float64,1},Array{Float64,2},Array{Float64,1}}, ::Array{Float64,1}, ::SubArray{Float64,1,Array{Float64,2},Tuple{Base.Slice{Base.OneTo{Int64}},Int64},true}) at C:\Users\Arnav Sood\.julia\packages\NLSolversBase\ylZ0n\src\interface.jl:178
[7] anderson_(::OnceDifferentiable{Array{Float64,1},Array{Float64,2},Array{Float64,1}}, ::Array{Float64,1}, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Int64, ::Float64, ::NLsolve.AndersonCache{Array{Float64,2},Array{Float64,1},Array{Float64,1},Array{Float64,1}}) at C:\Users\Arnav Sood\.julia\dev\NLsolve\src\solvers\anderson.jl:54
[8] anderson at C:\Users\Arnav Sood\.julia\dev\NLsolve\src\solvers\anderson.jl:122 [inlined] (repeats 2 times)
[9] #nlsolve#14(::Symbol, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Static, ::Float64, ::Bool, ::Int64, ::Float64, ::typeof(nlsolve), ::OnceDifferentiable{Array{Float64,1},Array{Float64,2},Array{Float64,1}}, ::Array{Float64,1}) at C:\Users\Arnav Sood\.julia\dev\NLsolve\src\nlsolve\nlsolve.jl:27
[10] #nlsolve at .\none:0 [inlined]
[11] #fixedpoint#20(::Symbol, ::Float64, ::Float64, ::Int64, ::Bool, ::Bool, ::Bool, ::Static, ::Float64, ::Bool, ::Int64, ::Float64, ::Symbol, ::Bool, ::typeof(fixedpoint), ::getfield(Main, Symbol("##3#4")){ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2}}, ::Array{Float64,1}) at C:\Users\Arnav Sood\.julia\dev\NLsolve\src\nlsolve\fixedpoint.jl:33
[12] #fixedpoint at .\none:0 [inlined]
[13] fp at C:\Users\Arnav Sood\desktop\adtest.jl:5 [inlined]
[14] #5 at C:\Users\Arnav Sood\desktop\adtest.jl:11 [inlined]
[15] vector_mode_dual_eval(::getfield(Main, Symbol("##5#6")), ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},1}}) at C:\Users\Arnav Sood\.julia\packages\ForwardDiff\hnKaN\src\apiutils.jl:35
[16] vector_mode_gradient(::getfield(Main, Symbol("##5#6")), ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},1}}) at C:\Users\Arnav Sood\.julia\packages\ForwardDiff\hnKaN\src\gradient.jl:96
[17] gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},1}}, ::Val{true}) at C:\Users\Arnav Sood\.julia\packages\ForwardDiff\hnKaN\src\gradient.jl:17
[18] gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2,Array{ForwardDiff.Dual{ForwardDiff.Tag{getfield(Main, Symbol("##5#6")),Float64},Float64,2},1}}) at C:\Users\Arnav Sood\.julia\packages\ForwardDiff\hnKaN\src\gradient.jl:15 (repeats 2 times)
[19] top-level scope at show.jl:555
[20] include at .\boot.jl:317 [inlined]
[21] include_relative(::Module, ::String) at .\loading.jl:1038
[22] include(::Module, ::String) at .\sysimg.jl:29
[23] exec_options(::Base.JLOptions) at .\client.jl:229
[24] _start() at .\client.jl:421
in expression starting at C:\Users\Arnav Sood\desktop\adtest.jl:11
from lecture-source-jl.
Ah, now I get the problem. I thought you got the issue in a call to fixedpoint
. You want to find the change in the fixedpoint when a parameter changes, right?
from lecture-source-jl.
@pkofod That's right. I don't think Jesse and I have enough manpower to iterate on this specific issue, but mainly wanted to bring it to your attention.
from lecture-source-jl.
Related Issues (20)
- Add precompiling some key packages to colab to increase perceived speed HOT 1
- Delete VSE Syzygy from the List
- Fix packages for pdf build HOT 3
- Fix font/latex pipeline to support more unicode HOT 4
- Upgrade everything to Julia 1.4.2 and document steps to upgrade a julia version
- A few clarifications on multiplying by adjoints
- Plots not showing in the pdf build HOT 3
- Width of instantiate cell added scrollbars again
- Theme Assets HOT 1
- Test JuliaPro 1.4 HOT 1
- Thoughts on covid and SciML lecture outline HOT 15
- Check Plots Stuff
- Document and add ModelingTookit.jl to Project (it is already in the manifest, no need to bump packages)
- Go Live on v0.8.0 and tag notebook repos HOT 1
- Some minor, redundant ;; in lectures HOT 1
- Update Images in GitHub Lecture to New Design Language HOT 1
- Fix the wald_friedman lecture
- Watch out for Julia 1.5 HOT 2
- McCall exercise solution index HOT 3
- Typo in Arellano 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 lecture-source-jl.