Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hong Ge <[email protected]>
  • Loading branch information
sunxd3 and yebai authored Dec 9, 2023
1 parent 65fb071 commit 0dfc064
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/essential/Essential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export @model,
AutoZygote,
AutoReverseDiff,
value,
verifygrad,
@logprob_str,
@prob_str

Expand Down
8 changes: 4 additions & 4 deletions src/mcmc/hmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
###

"""
HMC(ϵ::Float64, n_leapfrog::Int; adtype::ADTypes.AbstractADType = ADTypes.AbstractADType=AutoForwardDiff(; chunksize=0))
HMC(ϵ::Float64, n_leapfrog::Int; adtype::ADTypes.AbstractADType = AutoForwardDiff(; chunksize=0))
Hamiltonian Monte Carlo sampler with static trajectory.
Expand All @@ -41,7 +41,7 @@ Hamiltonian Monte Carlo sampler with static trajectory.
- `ϵ`: The leapfrog step size to use.
- `n_leapfrog`: The number of leapfrog steps to use.
- `adtype`: The automatic differentiation (AD) backend.
If not specified, ForwardDiff is used with an automatically determined chunksize.
If not specified, `ForwardDiff` is used, with its `chunksize` automatically determined.
# Usage
Expand Down Expand Up @@ -298,7 +298,7 @@ HMCDA(200, 0.65, 0.3)
- `λ`: Target leapfrog length.
- `ϵ`: Initial step size; 0 means automatically search by Turing.
- `adtype`: The automatic differentiation (AD) backend.
If not specified, ForwardDiff is used with an automatically determined chunksize.
If not specified, `ForwardDiff` is used, with its `chunksize` automatically determined.
# Reference
Expand Down Expand Up @@ -373,7 +373,7 @@ Arguments:
- `Δ_max::Float64` : Maximum divergence during doubling tree.
- `init_ϵ::Float64` : Initial step size; 0 means automatically searching using a heuristic procedure.
- `adtype::ADTypes.AbstractADType` : The automatic differentiation (AD) backend.
If not specified, ForwardDiff is used with an automatically determined chunksize.
If not specified, `ForwardDiff` is used, with its `chunksize` automatically determined.
"""
struct NUTS{AD,space,metricT<:AHMC.AbstractMetric} <: AdaptiveHamiltonian
Expand Down
8 changes: 4 additions & 4 deletions src/mcmc/sghmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ end
Create a Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) sampler.
If the automatic differentiation (AD) backend `adtype` is not provided, ForwardDiff is used
with automatically determined chunk size.
If the automatic differentiation (AD) backend `adtype` is not provided, ForwardDiff
with automatically determined `chunksize` is used.
# Reference
Expand Down Expand Up @@ -170,8 +170,8 @@ Stochastic gradient Langevin dynamics (SGLD) sampler.
By default, a polynomially decaying stepsize is used.
If the automatic differentiation (AD) backend `adtype` is not provided, ForwardDiff is used
with automatically determined chunk size.
If the automatic differentiation (AD) backend `adtype` is not provided, ForwardDiff
with automatically determined `chunksize` is used.
# Reference
Expand Down

0 comments on commit 0dfc064

Please sign in to comment.