You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@warn"failed to find valid initial parameters in$(init_attempt_count)tries; consider providing explicit initial parameters using the `initial_params` keyword"
48
+
for attempts in1:n_max_attempts
49
+
ifattempts==10
50
+
@warn"Failed to find valid initial parameters after$(init_attempt_count)attempts; consider providing explicit initial parameters using the `initial_params` keyword"
47
51
end
48
52
49
53
# NOTE: This will sample in the unconstrained space.
@@ -52,10 +56,15 @@ function SliceSampling.initial_sample(rng::Random.AbstractRNG, ℓ::Turing.LogDe
52
56
rng, model, vi, Turing.SampleFromUniform()
53
57
),
54
58
)
55
-
θ = vi_spl[:]
59
+
θ = vi_spl[:]
60
+
ℓp = LogDensityProblems.logdensity(ℓ, θ)
56
61
57
-
init_attempt_count +=1
62
+
ifall(isfinite.(θ)) &&isfinite(ℓp)
63
+
return θ
64
+
end
58
65
end
66
+
67
+
@error"Failed to find valid initial parameters after $(n_max_attempts) attempts; consider providing explicit initial parameters using the `initial_params` keyword"
0 commit comments