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
function autodiff_gradient(model::AdvancedMH.DensityModel, params, autodiff_protocol)
222
-
if autodiff_protocol == GradFreeProtocol
223
-
throw(
224
-
ArgumentError(
225
-
"Calling gradient on a Sampling with `GradFreeProtocol`. \n Please construct the `XYZSampling{<:AutodiffProtocol}()` object with `AutodiffProtocol` from the implemented options that is compatible with the chosen Emulator (e.g., `AbstractGP` emulators are compatible with `ForwardDiffProtocol`).",
"autodifferentiation protocol $(autodiff_protocol) has no `autodiff_gradient` method implemented.",
229
+
"Calling `autodiff_gradient(...)` on a sampler with protocol $(autodiff_protocol)that has *no* gradient implementation.\n Please select from a protocol with a gradient implementation (e.g., `ForwardDiffProtocol`).",
236
230
),
237
231
)
238
232
end
@@ -243,22 +237,17 @@ autodiff_gradient(model::AdvancedMH.DensityModel, params, sampler::MH) where {MH
243
237
autodiff_gradient(model::AdvancedMH.DensityModel, params, typeof(sampler).parameters[2]) # hacky way of getting the "AutodiffProtocol"
244
238
245
239
function autodiff_hessian(model::AdvancedMH.DensityModel, params, autodiff_protocol)
246
-
if autodiff_protocol == GradFreeProtocol
247
-
throw(
248
-
ArgumentError(
249
-
"Calling hessian on a Sampling with `GradFreeProtocol`. \n Please construct the `XYZSampling{<:AutodiffProtocol}()` object with `AutodiffProtocol` from the implemented options that is compatible with the chosen Emulator (e.g., `AbstractGP` emulators are compatible with `ForwardDiffProtocol`).",
"autodifferentiation protocol $(autodiff_protocol) has no `autodiff_hessian` method implemented.",
247
+
"Calling `autodiff_hessian(...)` on a sampler with protocol $(autodiff_protocol)that has *no* hessian implementation.\n Please select from a protocol with a hessian implementation (e.g., `ForwardDiffProtocol`).",
0 commit comments