We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max
This was a bad MWE! Nevermind.
Perhaps I'm doing something silly, but it looks like broadcasted max is not supported as a differentiable function?
> using ForwardDiff > f(x::Vector) = max.(x,0.); > g = x-> ForwardDiff.gradient(f,x); > x = rand(3) 0.326712 0.362656 0.832167 > f(x) 0.326712 0.362656 0.832167 > g(x) MethodError: no method matching extract_gradient!(::Type{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64}}, ::Array{Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3},1},1}, ::Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3},1}) Closest candidates are: extract_gradient!(::Type{T}, ::AbstractArray, !Matched::ForwardDiff.Dual) where T at /Users/weymouth/.julia/packages/ForwardDiff/qTmqf/src/gradient.jl:79 extract_gradient!(::Type{T}, ::AbstractArray, !Matched::Real) where T at /Users/weymouth/.julia/packages/ForwardDiff/qTmqf/src/gradient.jl:78 extract_gradient!(::Type{T}, !Matched::DiffResults.DiffResult, !Matched::ForwardDiff.Dual) where T at /Users/weymouth/.julia/packages/ForwardDiff/qTmqf/src/gradient.jl:72 ... vector_mode_gradient(::typeof(Main.workspace397.f), ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3,Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3},1}})@gradient.jl:101 gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3,Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3},1}}, ::Val{true})@gradient.jl:19 gradient(::Function, ::Array{Float64,1}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3,Array{ForwardDiff.Dual{ForwardDiff.Tag{typeof(Main.workspace397.f),Float64},Float64,3},1}})@gradient.jl:17 (::Main.workspace397.var"#1#2")(::Array{Float64,1})@Other: 1 top-level scope@Local: 1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This was a bad MWE! Nevermind.
Perhaps I'm doing something silly, but it looks like broadcasted
max
is not supported as a differentiable function?The text was updated successfully, but these errors were encountered: