Skip to content

Commit cf54955

Browse files
committed
Split code blocks in Inference doc page
1 parent 51a3441 commit cf54955

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docs/src/inference.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ m = sfcc_model(Trange, θtrue) # condition on data
2323
# draw 1,000 samples using the No U-Turn Sampler; gradients are computed automatically by Turing using forward-mode automatic differentiation (ForwardDiff.jl).
2424
chain = sample(rng, m, NUTS(), 1000)
2525
display(chain)
26-
# output
26+
```
27+
Output:
28+
```
2729
Chains MCMC chain (1000×18×1 Array{Float64, 3}):
2830
2931
Iterations = 501:1:1500
@@ -75,7 +77,9 @@ If you aren't interested in the full posterior distribution, Turing also provide
7577
using Optim
7678

7779
optimize(m, MAP(), LBFGS())
78-
# output
80+
```
81+
Output:
82+
```
7983
ModeResult with maximized lp of 394.29
8084
6-element Named Vector{Float64}
8185
A │
@@ -93,7 +97,9 @@ Alternatively, one can ignore the prior entirely and just get a *maximum likelih
9397
```julia
9498
# here we use the common LBFGS optimizer; see Optim.jl docs for more options
9599
optimize(m, MLE(), LBFGS())
96-
# output
100+
```
101+
Output:
102+
```
97103
ModeResult with maximized lp of 394.29
98104
6-element Named Vector{Float64}
99105
A │

src/Inference/Inference.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const param_name_map = Dict(
121121
θfrac_dispersion, θres_dispersion = priors.θfrac_dispersion, priors.θres_dispersion
122122
θsat, θtot, θres = @submodel swpmodel(SoilWaterVolume(fc); θfrac_dispersion, θres_dispersion)
123123
θ_pred = fc.(T; θsat, θtot, θres, Tₘ, pname => p)
124-
# truncated normal likelihood with beta distributed noise
124+
# truncated normal likelihood
125125
σ ~ priors.σ
126126
θ ~ arraydist(truncated.(Normal.(θ_pred,σ), 0, 1))
127127
return θ_pred
@@ -149,7 +149,7 @@ sfccpriors(::SFCCModel{<:DallAmico,IsoNormal}) = (
149149
θfrac_dispersion, θres_dispersion = priors.θfrac_dispersion, priors.θres_dispersion
150150
θsat, θtot, θres = @submodel swpmodel(SoilWaterVolume(fc); θfrac_dispersion, θres_dispersion)
151151
θ_pred = fc.(T; θsat, θtot, θres, Tₘ, α, n)
152-
# truncated normal likelihood with beta distributed noise
152+
# truncated normal likelihood
153153
σ ~ priors.σ
154154
θ ~ arraydist(truncated.(Normal.(θ_pred,σ), 0, 1))
155155
return θ_pred

0 commit comments

Comments
 (0)