Skip to content

add Tapir support

add Tapir support #134

Triggered via pull request August 22, 2024 08:02
@yebaiyebai
synchronize #71
Red-Portal:tapir
Status Success
Total duration 5m 24s
Artifacts

Documentation.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
failed to run `@setup` block in src/elbo/repgradelbo.md ```@setup repgradelbo max_iter = 3*10^3 function callback(; params, restructure, kwargs...) q = restructure(params).dist dist2 = sum(abs2, q.location - vcat([μ_x], μ_y)) + sum(abs2, diag(q.scale) - vcat(σ_x, σ_y)) (dist = sqrt(dist2),) end _, _, stats_cfe, _ = AdvancedVI.optimize( model, cfe, q0_trans, max_iter; show_progress = false, adtype = AutoForwardDiff(), optimizer = Optimisers.Adam(3e-3), callback = callback, ); _, _, stats_stl, _ = AdvancedVI.optimize( model, repgradelbo, q0_trans, max_iter; show_progress = false, adtype = AutoForwardDiff(), optimizer = Optimisers.Adam(3e-3), callback = callback, ); t = [stat.iteration for stat in stats_cfe] elbo_cfe = [stat.elbo for stat in stats_cfe] elbo_stl = [stat.elbo for stat in stats_stl] dist_cfe = [stat.dist for stat in stats_cfe] dist_stl = [stat.dist for stat in stats_stl] plot( t, elbo_cfe, label="BBVI CFE", xlabel="Iteration", ylabel="ELBO") plot!(t, elbo_stl, label="BBVI STL", xlabel="Iteration", ylabel="ELBO") savefig("advi_stl_elbo.svg") plot( t, dist_cfe, label="BBVI CFE", xlabel="Iteration", ylabel="distance to optimum", yscale=:log10) plot!(t, dist_stl, label="BBVI STL", xlabel="Iteration", ylabel="distance to optimum", yscale=:log10) savefig("advi_stl_dist.svg") nothing ``` exception = LoadError: MethodError: no method matching value_and_gradient!(::ADTypes.AutoForwardDiff{nothing, Nothing}, ::typeof(AdvancedVI.estimate_repgradelbo_ad_forward), ::Vector{Float64}, ::@NamedTuple{rng::Random.TaskLocalRNG, adtype::ADTypes.AutoForwardDiff{nothing, Nothing}, obj::RepGradELBO{ClosedFormEntropy}, problem::Main.__atexample__named__repgradelbo.NormalLogNormal{Float64, Float64, FillArrays.Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}, LinearAlgebra.Diagonal{Float64, FillArrays.Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}}}, restructure::Optimisers.Restructure{Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}, @NamedTuple{dist::@NamedTuple{location::Int64, scale::Int64}, transform::@NamedTuple{bs::Vector{Any}}}}, q_stop::Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}}, ::DiffResults.MutableDiffResult{1, Float64, Tuple{Vector{Float64}}}) Closest candidates are: value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:16 value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::Any, !Matched::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:33 in expression starting at string:8
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
failed to run `@setup` block in src/elbo/repgradelbo.md ```@setup repgradelbo repgradelbo = AdvancedVI.RepGradELBO(n_montecarlo); _, _, stats_qmc, _ = AdvancedVI.optimize( model, repgradelbo, q0_trans, max_iter; show_progress = false, adtype = AutoForwardDiff(), optimizer = Optimisers.Adam(3e-3), callback = callback, ); t = [stat.iteration for stat in stats_qmc] elbo_qmc = [stat.elbo for stat in stats_qmc] dist_qmc = [stat.dist for stat in stats_qmc] plot( t, elbo_cfe, label="BBVI CFE", xlabel="Iteration", ylabel="ELBO") plot!(t, elbo_qmc, label="BBVI CFE QMC", xlabel="Iteration", ylabel="ELBO") savefig("advi_qmc_elbo.svg") plot( t, dist_cfe, label="BBVI CFE", xlabel="Iteration", ylabel="distance to optimum", yscale=:log10) plot!(t, dist_qmc, label="BBVI CFE QMC", xlabel="Iteration", ylabel="distance to optimum", yscale=:log10) savefig("advi_qmc_dist.svg") # The following definition is necessary to revert the behavior of `rand` so that # the example in example.md works with the regular non-QMC estimator. function Distributions.rand( rng::AbstractRNG, q::MvLocationScale{<:Diagonal, D, L}, num_samples::Int ) where {L, D} @unpack location, scale, dist = q n_dims = length(location) scale_diag = diag(scale) scale_diag.*rand(rng, dist, n_dims, num_samples) .+ location end nothing ``` exception = LoadError: MethodError: no method matching value_and_gradient!(::ADTypes.AutoForwardDiff{nothing, Nothing}, ::typeof(AdvancedVI.estimate_repgradelbo_ad_forward), ::Vector{Float64}, ::@NamedTuple{rng::Random.TaskLocalRNG, adtype::ADTypes.AutoForwardDiff{nothing, Nothing}, obj::RepGradELBO{ClosedFormEntropy}, problem::Main.__atexample__named__repgradelbo.NormalLogNormal{Float64, Float64, FillArrays.Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}, LinearAlgebra.Diagonal{Float64, FillArrays.Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}}}, restructure::Optimisers.Restructure{Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}, @NamedTuple{dist::@NamedTuple{location::Int64, scale::Int64}, transform::@NamedTuple{bs::Vector{Any}}}}, q_stop::Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}}, ::DiffResults.MutableDiffResult{1, Float64, Tuple{Vector{Float64}}}) Closest candidates are: value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:16 value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::Any, !Matched::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:33 in expression starting at string:1
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
failed to run `@example` block in src/examples.md:112-124 ```@example elboexample n_max_iter = 10^4 q_avg_trans, q_trans, stats, _ = AdvancedVI.optimize( model, objective, q0_trans, n_max_iter; show_progress=false, adtype=AutoForwardDiff(), optimizer=Optimisers.Adam(1e-3), ); nothing ``` value = MethodError: no method matching value_and_gradient!(::ADTypes.AutoForwardDiff{nothing, Nothing}, ::typeof(AdvancedVI.estimate_repgradelbo_ad_forward), ::Vector{Float64}, ::@NamedTuple{rng::Random.TaskLocalRNG, adtype::ADTypes.AutoForwardDiff{nothing, Nothing}, obj::RepGradELBO{ClosedFormEntropy}, problem::Main.__atexample__named__elboexample.NormalLogNormal{Float64, Float64, Vector{Float64}, LinearAlgebra.Diagonal{Float64, Vector{Float64}}}, restructure::Optimisers.Restructure{Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}, @NamedTuple{dist::@NamedTuple{location::Int64, scale::Int64}, transform::@NamedTuple{bs::Vector{Any}}}}, q_stop::Bijectors.MultivariateTransformed{MvLocationScale{LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Distributions.Normal{Float64}, Vector{Float64}, Float64}, Bijectors.Stacked{Vector{Function}, Vector{UnitRange{Int64}}}}}, ::DiffResults.MutableDiffResult{1, Float64, Tuple{Vector{Float64}}}) Closest candidates are: value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:16 value_and_gradient!(::ADTypes.AutoForwardDiff, ::Any, ::Any, !Matched::AbstractVector, ::Any, !Matched::DiffResults.MutableDiffResult) @ AdvancedVIForwardDiffExt ~/work/AdvancedVI.jl/AdvancedVI.jl/ext/AdvancedVIForwardDiffExt.jl:33
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
failed to run `@example` block in src/examples.md:132-140 ```@example elboexample using Plots t = [stat.iteration for stat in stats] y = [stat.elbo for stat in stats] plot(t, y; label="BBVI", xlabel="Iteration", ylabel="ELBO") savefig("bbvi_example_elbo.svg") nothing ``` value = UndefVarError: `stats` not defined
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
failed to run `@example` block in src/examples.md:148-150 ```@example elboexample estimate_objective(objective, q_avg_trans, model; n_samples=10^4) ``` value = UndefVarError: `q_avg_trans` not defined
build: ../../../.julia/packages/Documenter/bYYzK/src/Utilities/Utilities.jl#L34
8 docstrings not included in the manual: AdvancedVI.update_variational_params! AdvancedVI.init_adbackend :: Tuple{ADTypes.AbstractADType, Any, Any} AdvancedVI.restructure_ad_forward :: Tuple{ADTypes.AbstractADType, Any, Any} AdvancedVI.value :: Tuple{AdvancedVI.AbstractAverager, Any} AdvancedVI.ClosedFormEntropy AdvancedVI.apply :: Tuple{AdvancedVI.AbstractAverager, Any, Any} AdvancedVI.estimate_entropy AdvancedVI.value_and_gradient! These are docstrings in the checked modules (configured with the modules keyword) that are not included in @docs or @autodocs blocks.
build: ../../../.julia/packages/Documenter/bYYzK/src/Writers/HTMLWriter.jl#L2103
invalid local image: unresolved path in examples.md link = "bbvi_example_elbo.svg"
build: ../../../.julia/packages/Documenter/bYYzK/src/Writers/HTMLWriter.jl#L2103
invalid local image: unresolved path in elbo/repgradelbo.md link = "advi_stl_elbo.svg"
build: ../../../.julia/packages/Documenter/bYYzK/src/Writers/HTMLWriter.jl#L2103
invalid local image: unresolved path in elbo/repgradelbo.md link = "advi_stl_dist.svg"
build: ../../../.julia/packages/Documenter/bYYzK/src/Writers/HTMLWriter.jl#L2103
invalid local image: unresolved path in elbo/repgradelbo.md link = "advi_qmc_elbo.svg"