Skip to content

Commit

Permalink
Fix BNN doc to work with Mooncake
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 25, 2024
1 parent 28fcc61 commit 24862bb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tutorials/03-bayesian-neural-network/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ rng = Random.default_rng()
Random.seed!(rng, 1234)
# Generate artificial data
x1s = rand(rng, Float32, M) * 4.5f0;
x2s = rand(rng, Float32, M) * 4.5f0;
x1s = rand(rng, M) * 4.5f0;
x2s = rand(rng, M) * 4.5f0;
xt1s = Array([[x1s[i] + 0.5f0; x2s[i] + 0.5f0] for i in 1:M])
x1s = rand(rng, Float32, M) * 4.5f0;
x2s = rand(rng, Float32, M) * 4.5f0;
x1s = rand(rng, M) * 4.5f0;
x2s = rand(rng, M) * 4.5f0;
append!(xt1s, Array([[x1s[i] - 5.0f0; x2s[i] - 5.0f0] for i in 1:M]))
x1s = rand(rng, Float32, M) * 4.5f0;
x2s = rand(rng, Float32, M) * 4.5f0;
x1s = rand(rng, M) * 4.5f0;
x2s = rand(rng, M) * 4.5f0;
xt0s = Array([[x1s[i] + 0.5f0; x2s[i] - 5.0f0] for i in 1:M])
x1s = rand(rng, Float32, M) * 4.5f0;
x2s = rand(rng, Float32, M) * 4.5f0;
x1s = rand(rng, M) * 4.5f0;
x2s = rand(rng, M) * 4.5f0;
append!(xt0s, Array([[x1s[i] - 5.0f0; x2s[i] + 0.5f0] for i in 1:M]))
# Store all the data for later
Expand Down Expand Up @@ -189,7 +189,7 @@ const nn = StatefulLuxLayer{true}(nn_initial, nothing, st)
parameters ~ MvNormal(zeros(nparameters), Diagonal(abs2.(sigma .* ones(nparameters))))
# Forward NN to make predictions
preds = Lux.apply(nn, xs, vector_to_parameters(parameters, ps))
preds = Lux.apply(nn, xs, f64(vector_to_parameters(parameters, ps)))
# Observe each prediction.
for i in eachindex(ts)
Expand Down

0 comments on commit 24862bb

Please sign in to comment.