Skip to content

Commit

Permalink
Merge pull request #262 from Julia-Tempering/miguelbiron-patch-1
Browse files Browse the repository at this point in the history
Clarify n_chains_variational docstring
  • Loading branch information
miguelbiron authored Jul 26, 2024
2 parents dcc6779 + 7e510b4 commit 30d9565
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/pt/Inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ $FIELDS
n_chains::Int = 10

"""
The number of chains to use for an additional variational reference leg.
Set to zero to disable (default).
Variational inference can also be performed using a single leg, however
the two-leg version is more stable: see https://arxiv.org/abs/2206.00080
The number of chains to use for a variational leg of parallel tempering.
The default value is zero. If the variational argument is not specified,
this argument does nothing. Otherwise, a value of zero corresponds
to basic single-leg variational parallel tempering, where the number of
chains is taken from the `n_chains` argument. A positive value yields "stabilized"
two-leg variational parallel tempering. In that case, the number of chains for the
prior-reference leg is taken from `n_chains`, and the number of chains for the variational
leg is taken from this argument. See https://arxiv.org/abs/2206.00080
"""
n_chains_variational::Int = 0

Expand Down Expand Up @@ -124,4 +128,4 @@ Extract the number of Parallel Tempering chains from `Inputs`.
n_chains(inputs::Inputs) = n_chains_fixed(inputs) + n_chains_var(inputs)
# TODO: generalize once you have "parallel parallel tempering", etc.
n_chains_fixed(inputs::Inputs) = inputs.n_chains
n_chains_var(inputs::Inputs) = inputs.n_chains_variational
n_chains_var(inputs::Inputs) = inputs.n_chains_variational

0 comments on commit 30d9565

Please sign in to comment.