Skip to content
New issue

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

Formatting all files #80

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Formatting all files #80

merged 1 commit into from
Aug 9, 2024

Conversation

yebai
Copy link
Member

@yebai yebai commented Aug 9, 2024

No description provided.

@yebai yebai merged commit bce1e35 into master Aug 9, 2024
2 of 9 checks passed
@yebai yebai deleted the hg/formatting branch August 9, 2024 14:50
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JuliaFormatter

[JuliaFormatter] reported by reviewdog 🐶

RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),


[JuliaFormatter] reported by reviewdog 🐶

optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,


[JuliaFormatter] reported by reviewdog 🐶

optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,


[JuliaFormatter] reported by reviewdog 🐶

optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,


[JuliaFormatter] reported by reviewdog 🐶

@test dropdims(mean(z_samples; dims=2); dims=2) μ rtol = realtype(1e-2)
@test dropdims(var(z_samples; dims=2); dims=2) diag(Σ) rtol = realtype(
1e-2
)
@test cov(z_samples; dims=2) Σ rtol = realtype(1e-2)


[JuliaFormatter] reported by reviewdog 🐶

@test dropdims(mean(z_samples; dims=2); dims=2) μ rtol = realtype(1e-2)
@test dropdims(var(z_samples; dims=2); dims=2) diag(Σ) rtol = realtype(
1e-2
)
@test cov(z_samples; dims=2) Σ rtol = realtype(1e-2)


[JuliaFormatter] reported by reviewdog 🐶

@test dropdims(mean(z_samples; dims=2); dims=2) μ rtol = realtype(1e-2)
@test dropdims(var(z_samples; dims=2); dims=2) diag(Σ) rtol = realtype(
1e-2
)
@test cov(z_samples; dims=2) Σ rtol = realtype(1e-2)


[JuliaFormatter] reported by reviewdog 🐶

@test dropdims(mean(z_samples; dims=2); dims=2) μ rtol = realtype(1e-2)
@test dropdims(var(z_samples; dims=2); dims=2) diag(Σ) rtol = realtype(
1e-2
)
@test cov(z_samples; dims=2) Σ rtol = realtype(1e-2)


[JuliaFormatter] reported by reviewdog 🐶

FullRankGaussian(μ, L; scale_eps=ϵ)


[JuliaFormatter] reported by reviewdog 🐶

MeanFieldGaussian(μ, L; scale_eps=ϵ)


[JuliaFormatter] reported by reviewdog 🐶

q_ref, stats_ref, _ = optimize(
rng, model, obj, q0, T; optimizer, show_progress=false, adtype
)


[JuliaFormatter] reported by reviewdog 🐶

optimize(model, obj, q0, T; optimizer, show_progress=false, adtype)


[JuliaFormatter] reported by reviewdog 🐶

callback(; stat, args...) = (test_value=test_values[stat.iteration],)


[JuliaFormatter] reported by reviewdog 🐶

_, stats, _ = optimize(
rng, model, obj, q0, T; show_progress=false, adtype, callback
)


[JuliaFormatter] reported by reviewdog 🐶

q_first, _, state = optimize(
rng, model, obj, q0, T_first; optimizer, show_progress=false, adtype
)


[JuliaFormatter] reported by reviewdog 🐶

show_progress=false,
state_init=state,


[JuliaFormatter] reported by reviewdog 🐶

elbo_ref = estimate_objective(rng, obj, q0, model; n_samples=10^4)


[JuliaFormatter] reported by reviewdog 🐶

elbo = estimate_objective(rng, obj, q0, model; n_samples=10^4)


[JuliaFormatter] reported by reviewdog 🐶

elbo = estimate_objective(obj, q0, model; n_samples=10^4)


[JuliaFormatter] reported by reviewdog 🐶

ADTypes.AutoForwardDiff(), ADTypes.AutoReverseDiff(), ADTypes.AutoZygote()


[JuliaFormatter] reported by reviewdog 🐶

Vector{eltype(μ_true)}(μ_true), Diagonal(Vector{eltype(L_true)}(diag(L_true)))


[JuliaFormatter] reported by reviewdog 🐶

obj = RepGradELBO(10; entropy=StickingTheLandingEntropy())


[JuliaFormatter] reported by reviewdog 🐶

ad, AdvancedVI.estimate_repgradelbo_ad_forward, params, aux, out


[JuliaFormatter] reported by reviewdog 🐶

[1:1, 2:(1 + length(μ_y))],


[JuliaFormatter] reported by reviewdog 🐶

μ[1], L[1, 1], μ[2:end], PDMat(Σ[2:end, 2:end], Cholesky(L[2:end, 2:end], 'L', 0))

location::AbstractVector{T},
scale::AbstractMatrix{T},
dist::ContinuousDistribution;
scale_eps::T=sqrt(eps(T)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
scale_eps::T=sqrt(eps(T)),
scale_eps::T = sqrt(eps(T)),

end

function Distributions.rand(
rng::AbstractRNG, q::MvLocationScale{S, D, L}, num_samples::Int
) where {S, D, L}
rng::AbstractRNG, q::MvLocationScale{S,D,L}, num_samples::Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
rng::AbstractRNG, q::MvLocationScale{S,D,L}, num_samples::Int
rng::AbstractRNG,
q::MvLocationScale{S,D,L},
num_samples::Int,

end

# This specialization improves AD performance of the sampling path
function Distributions.rand(
rng::AbstractRNG, q::MvLocationScale{<:Diagonal, D, L}, num_samples::Int
) where {L, D}
rng::AbstractRNG, q::MvLocationScale{<:Diagonal,D,L}, num_samples::Int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
rng::AbstractRNG, q::MvLocationScale{<:Diagonal,D,L}, num_samples::Int
rng::AbstractRNG,
q::MvLocationScale{<:Diagonal,D,L},
num_samples::Int,

end

function Distributions._rand!(rng::AbstractRNG, q::MvLocationScale, x::AbstractVecOrMat{<:Real})
function Distributions._rand!(
rng::AbstractRNG, q::MvLocationScale, x::AbstractVecOrMat{<:Real}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
rng::AbstractRNG, q::MvLocationScale, x::AbstractVecOrMat{<:Real}
rng::AbstractRNG,
q::MvLocationScale,
x::AbstractVecOrMat{<:Real},

L::LinearAlgebra.AbstractTriangular{T};
scale_eps::T = sqrt(eps(T))
) where {T <: Real}
μ::AbstractVector{T}, L::LinearAlgebra.AbstractTriangular{T}; scale_eps::T=sqrt(eps(T))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
μ::AbstractVector{T}, L::LinearAlgebra.AbstractTriangular{T}; scale_eps::T=sqrt(eps(T))
μ::AbstractVector{T},
L::LinearAlgebra.AbstractTriangular{T};
scale_eps::T = sqrt(eps(T)),

Comment on lines +82 to +84
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
optimizer = opt,
show_progress = PROGRESS,
adtype = adtype,

:RepGradELBOStickingTheLanding => RepGradELBO(n_montecarlo, entropy = StickingTheLandingEntropy()),
:RepGradELBOClosedFormEntropy => RepGradELBO(n_montecarlo),
:RepGradELBOStickingTheLanding =>
RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
RepGradELBO(n_montecarlo; entropy=StickingTheLandingEntropy()),
RepGradELBO(n_montecarlo; entropy = StickingTheLandingEntropy()),

Comment on lines +50 to +52
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
optimizer = opt,
show_progress = PROGRESS,
adtype = adtype,

Comment on lines +72 to +74
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
optimizer = opt,
show_progress = PROGRESS,
adtype = adtype,

Comment on lines +86 to +88
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
optimizer=opt,
show_progress=PROGRESS,
adtype=adtype,
optimizer = opt,
show_progress = PROGRESS,
adtype = adtype,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

opt_st, params = update_variational_params!(
typeof(q_init), opt_st, params, restructure, grad
)

yebai added a commit that referenced this pull request Aug 9, 2024
yebai added a commit that referenced this pull request Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant