Comments (1)
Perhaps worth noting that you get a different error if the coefficients are an argument,
so that vect
and vect_pullback
are not involved:
julia> using Zygote
julia> gradient((x,c) -> sum(evalpoly.(x, Ref(c))), [2.0], [1,2,3])
([14.0], [1.0, 2.0, 4.0])
julia> gradient((x,c) -> sum(evalpoly.(x, Ref(c))), [2.0], [1,2,3.5])
ERROR: DimensionMismatch: array with ndims(x) == 1 > 0 cannot have dx::Number
Stacktrace:
[1] (::ChainRulesCore.ProjectTo{AbstractArray, @NamedTuple{…}})(dx::Float64)
@ ChainRulesCore ~/.julia/packages/ChainRulesCore/6DiyF/src/projection.jl:255
[2] _project
@ ~/.julia/packages/Zygote/jxHJc/src/compiler/chainrules.jl:189 [inlined]
[3] map
@ ./tuple.jl:383 [inlined]
[4] _project_all(x::Tuple{Vector{Float64}, Vector{Float64}}, dx::Tuple{Vector{Float64}, Float64})
@ Zygote ~/.julia/packages/Zygote/jxHJc/src/compiler/interface.jl:118
[5] gradient(::Function, ::Vector{Float64}, ::Vararg{Any})
@ Zygote ~/.julia/packages/Zygote/jxHJc/src/compiler/interface.jl:149
[6] top-level scope
@ REPL[334]:1
Some type information was truncated. Use `show(err)` to see complete types.
julia> Zygote.pullback((x,c) -> sum(evalpoly.(x, Ref(c))), [2.0], [1,2,3.5]) # this avoids projection of final answer
(19.0, Zygote.var"#75#76"{Zygote.Pullback...
julia> ans[2](1.0)
([16.0], 0.0)
from zygote.jl.
Related Issues (20)
- `gradient` broken for `(*)(::Diagonal{Real}, ::Matrix{Complex}, ::Diagonal{Real})` when updating Julia 1.8 -> 1.9 HOT 6
- Method ambiguities reported by Aqua
- slow/high allocation gradient with mapreduce and iterators HOT 11
- error in summation of product iterator HOT 2
- `sort(x; rev=true)` is not supported HOT 1
- Incorrect gradients for `plan_rfft(x) * x` HOT 2
- Gradient of scalar function of gradient giving mutating array error HOT 4
- `sum` with CUDA and view on array errors HOT 3
- Cannot take gradient of sort on 2D CuArray HOT 1
- Strip zygote frames from mutation error stack trace HOT 1
- Zygote in Julia 1.10+ not reading rrules for default constructors HOT 7
- Few issues in the Zygote Home Page documentation HOT 1
- OOM when computing the gradient in an embarrassingly parallel problem HOT 1
- Pullback over jacobian HOT 6
- `withjacobian` flattens the output when it is a matrix HOT 1
- Gradient wrt to a sparse matrix is mathematically wrong HOT 6
- Increasing memory usage in each call of gradient HOT 1
- Precompilation error in Julia nightly HOT 1
- Gradient involving `LinearAlgebra.tr` errors HOT 1
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 zygote.jl.