Clean code #518
Annotations
4 warnings
Documentation (1.9, ubuntu-latest, x64):
../../../.julia/packages/Documenter/nQAq5/src/utilities/utilities.jl#L46
failed to run `@example` block in src/examples/ad-tn.md:44-69
```@example autodiff
η = 0.01
@time losses = map(1:200) do it
# compute gradient
loss, ∇ = withgradient(Params(arrays(ψ))) do
((contract(tn) |> first) - 1)^2
end
# direct gradient descent
for array in arrays(ψ)
array .-= η * ∇[array]
end
# normalize state
normalize!(ψ)
return loss
end
f = Figure() # hide
ax = Axis(f[1, 1], yscale = log10, xscale = identity, xlabel="Iterations") # hide
lines!(losses, label="Loss") # hide
lines!(map(x -> 1 - sqrt(x), losses), label="Overlap") # hide
f[1,2] = Legend(f, ax, framevisible=false) # hide
f # hide
```
exception =
MethodError: no method matching (::ChainRulesCore.ProjectTo{Tensor{Float64, 0, Array{Float64, 0}}, NamedTuple{(:data, :inds), Tuple{ChainRulesCore.ProjectTo{AbstractArray, NamedTuple{(:element, :axes), Tuple{ChainRulesCore.ProjectTo{Float64, NamedTuple{(), Tuple{}}}, Tuple{}}}}, ImmutableArrays.ImmutableVector{Symbol, Vector{Symbol}}}}})(::Array{Float64, 0})
Closest candidates are:
(::ChainRulesCore.ProjectTo{T})(!Matched::Union{ChainRulesCore.Tangent{T}, T}) where T<:Tensor
@ TenetChainRulesCoreExt ~/work/Tenet.jl/Tenet.jl/ext/TenetChainRulesCoreExt.jl:11
(::ChainRulesCore.ProjectTo)(!Matched::ChainRulesCore.InplaceableThunk)
@ ChainRulesCore ~/.julia/packages/ChainRulesCore/7MWx2/src/projection.jl:125
(::ChainRulesCore.ProjectTo)(!Matched::ChainRulesCore.Thunk)
@ ChainRulesCore ~/.julia/packages/ChainRulesCore/7MWx2/src/projection.jl:124
...
Stacktrace:
[1] ∇getindex(x::Tensor{Float64, 0, Array{Float64, 0}}, dy::Float64, inds::Int64)
@ ChainRules ~/.julia/packages/ChainRules/snrkz/src/rulesets/Base/indexing.jl:91
[2] (::ChainRules.var"#1602#1604"{Tensor{Float64, 0, Array{Float64, 0}}, Float64, Tuple{Int64}})()
@ ChainRules ~/.julia/packages/ChainRules/snrkz/src/rulesets/Base/indexing.jl:69
[3] unthunk
@ ~/.julia/packages/ChainRulesCore/7MWx2/src/tangent_types/thunks.jl:204 [inlined]
[4] unthunk(x::ChainRulesCore.InplaceableThunk{ChainRulesCore.Thunk{ChainRules.var"#1602#1604"{Tensor{Float64, 0, Array{Float64, 0}}, Float64, Tuple{Int64}}}, ChainRules.var"#1601#1603"{Tensor{Float64, 0, Array{Float64, 0}}, Float64, Tuple{Int64}}})
@ ChainRulesCore ~/.julia/packages/ChainRulesCore/7MWx2/src/tangent_types/thunks.jl:237
[5] wrap_chainrules_output
@ ~/.julia/packages/Zygote/YYT6v/src/compiler/chainrules.jl:110 [inlined]
[6] map
@ ./tuple.jl:275 [inlined]
[7] wrap_chainrules_output
@ ~/.julia/packages/Zygote/YYT6v/src/compiler/chainrules.jl:111 [inlined]
[8] ZBack
@ ~/.julia/packages/Zygote/YYT6v/src/compiler/chainrules.jl:211 [inlined]
[9] Pullback
@ ./abstractarray.jl:445 [inlined]
[10] (::Zygote.Pullback{Tuple{typeof(first), Tensor{Float64, 0, Array{Float64, 0}}}, Tuple{Zygote.Pullback{Tuple{typeof(first), Base.OneTo{Int64}}, Tuple{Zygote.Pullback{Tuple{typeof(oneunit), Type{Int64}}, Tuple{Zygote.ZBack{Zygote.var"#IntX_pullback#335"}, Zygote.ZBack{ChainRules.var"#one_pullback#793"}}}}}, Zygote.ZBack{ChainRules.var"#eachindex_pullback#376"{Tuple{Tensor{Float64, 0, Array{Float64, 0}}}}}, Zygote.ZBack{ChainRules.var"#getindex_pullback#1600"{Tensor{Float64, 0, Array{Float64, 0}}, Tuple{Int64}, Tuple{ChainRulesCore.NoTangent}}}}})(Δ::Float64)
@ Zygote ~/.julia/packages/Zygote/YYT6v/src/compiler/interface2.jl:0
[11] Pullback
@ ./operators.jl:907 [inlined]
[12] (::Zygote.Pullback{Tuple{typeof(|>), Tensor{Float64, 0, Array{Float64, 0}}, typeof(first)}, Tuple{Zygote.Pullback{Tuple{typeof(first), Tensor{Float64, 0, Array{Float64, 0}}}, Tuple{Zygote.Pullback{Tuple{typeof(first), Base.OneTo{Int64}}, Tuple{Zygote.Pullback{Tuple{typeof(oneunit), Type{Int64}}, Tuple{Zygote.ZBack{Zygote.var"#IntX_pullback#335"}, Zygote.ZBack{ChainRules.var"#one_pullback#793"}}}}}, Zygote.ZBack{ChainRules.var"#eachindex_pullback#376"{Tuple{Tensor{Float64, 0, Array{Flo
|
|
Documentation (1.9, ubuntu-latest, x64):
../../../.julia/packages/Documenter/nQAq5/src/deploydocs.jl#L464
removing `stable` and linking `stable` to `v0.3.0`.
|
Documentation (1.9, ubuntu-latest, x64):
../../../.julia/packages/Documenter/nQAq5/src/deploydocs.jl#L464
removing `v0.3` and linking `v0.3` to `v0.3.0`.
|