From 28fcc616ebc286d504a8adae9b71df430057be7f Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Mon, 25 Nov 2024 19:02:51 +0000 Subject: [PATCH] Use Mooncake in BNN doc (#521) --- tutorials/03-bayesian-neural-network/index.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/03-bayesian-neural-network/index.qmd b/tutorials/03-bayesian-neural-network/index.qmd index fcfa7502f..87d556634 100755 --- a/tutorials/03-bayesian-neural-network/index.qmd +++ b/tutorials/03-bayesian-neural-network/index.qmd @@ -19,7 +19,7 @@ using Turing using FillArrays using Lux using Plots -using Tracker +import Mooncake using Functors using LinearAlgebra @@ -208,7 +208,7 @@ setprogress!(false) ```{julia} # Perform inference. N = 2_000 -ch = sample(bayes_nn(reduce(hcat, xs), ts), NUTS(; adtype=AutoTracker()), N); +ch = sample(bayes_nn(reduce(hcat, xs), ts), NUTS(; adtype=AutoMooncake(; config=nothing)), N); ``` Now we extract the parameter samples from the sampled chain as `θ` (this is of size `5000 x 20` where `5000` is the number of iterations and `20` is the number of parameters).