Comments (3)
This is the current behaviour on julia 0.7 for the MWE
julia> using AutoGrad
julia> f(x) = x.^2
f (generic function with 1 method)
julia> jf = AutoGrad.grad(f)
(::getfield(AutoGrad, Symbol("#gradfun#3")){getfield(AutoGrad, Symbol("##gradfun#1#2")){typeof(f),Int64}}) (generic function with 1 method)
julia> jf(1)
┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::Rec{Int64}` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│ caller = ip:0x0
└ @ Core :-1
2
While the result is correct, the warning is hinting at some pitfall in our current implementation of broadcast for recorded scalars.
This example works smoothly though:
julia> f(x) = sum(x.*[1,2,3])
f (generic function with 1 method)
julia> grad(f)(1)
6
from autograd.jl.
This should be fixed in latest master, please test and close.
from autograd.jl.
Works, thanks!
from autograd.jl.
Related Issues (20)
- grad doesn't work on trivial identity HOT 6
- Copy of param is value of param HOT 3
- bug in gradient with broadcast HOT 3
- cannot take derivative of a scalar function HOT 6
- Atom can’t evaluate a line which the regular REPL can
- Inside `@diff`, shouldn't `similar(Result{Array})` return `Result{Array}`? HOT 1
- mapslices and Param wrapped arrays
- Extend UngetIndex to multiple indices, values for efficiency HOT 1
- Autograd.Sparse type causes regression HOT 10
- getindex gradient collection bug
- Cannot `convert` an object of type UnitRange{Int64} to an object of type Colon
- Multiple functions sharing some gradients HOT 1
- Problems with grad after grad HOT 2
- Alkan bias add problem? HOT 1
- TagBot trigger issue HOT 2
- how to calculate gradient without calculating function outputs
- keyword args in broadcasted funcs not supported
- Param(x) as AbstractArray? HOT 1
- Incorrect derivatives when new arrays are constructed in computation
- AutoGrad and CUDA kernels 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 autograd.jl.