BaytesOptim.ConfigLBFG
— Typestruct ConfigLBFG{R<:Real} <: BaytesCore.AbstractConfiguration
Default Configuration for LBFG optimizer.
Fields
magnitude_penalty::Real
: Add-0.5 * magnitude_penalty * sum(abs2, q)
to the log posterior when finding the local optimum. This can help avoid getting into high-density edge areas of the posterior which are otherwise not typical (eg multilevel models).
iterations::Int64
: Maximum number of iterations in the optimization algorithm. Recall that we don't need to find the mode, or even a local mode, just be in a reasonable region.
difforder::BaytesDiff.DiffOrderOne
: Differentiable order for objective function needed to run propagate step
BaytesOptim.ConfigSGD
— Typestruct ConfigSGD{R<:Real, A<:UpdateBool} <: BaytesCore.AbstractConfiguration
Default Configuration for SGD optimizer.
Fields
magnitude_penalty::Real
: Add-0.5 * magnitude_penalty * sum(abs2, q)
to the log posterior when finding the local optimum. This can help avoid getting into high-density edge areas of the posterior which are otherwise not typical (eg multilevel models).
magnitude_adaption::UpdateBool
: Adapt magnitude iteratively for each step ~ currently not implemented
iterations::Int64
: Maximum number of iterations in the optimization algorithm. Recall that we don't need to find the mode, or even a local mode, just be in a reasonable region.
difforder::BaytesDiff.DiffOrderOne
: Differentiable order for objective function needed to run propagate step
BaytesOptim.CustomAlgorithm
— Typemutable struct CustomAlgorithm{R<:BaytesDiff.ℓDensityResult, T<:CustomAlgorithmTune} <: BaytesCore.AbstractAlgorithm
Stores information for proposal step.
Fields
result::BaytesDiff.ℓDensityResult
tune::CustomAlgorithmTune
BaytesOptim.CustomAlgorithmConstructor
— TypeCallable struct to make initializing Algorithm easier in sampling library.
Examples
BaytesOptim.CustomAlgorithmDefault
— Typestruct CustomAlgorithmDefault{I<:AbstractInitialization, U<:UpdateBool}
Default arguments for Custom constructor.
Fields
init::AbstractInitialization
: Method to obtain initial Modelparameter, see 'AbstractInitialization'.generated::UpdateBool
: Boolean if generate(_rng, objective) for corresponding model is stored in Algorithm Diagnostics.
BaytesOptim.CustomAlgorithmTune
— Typestruct CustomAlgorithmTune{T<:ModelWrappers.Tagged, B<:UpdateBool} <: BaytesCore.AbstractTune
Stores information used throughout custom algorithm.
Fields
tagged::ModelWrappers.Tagged
: Tagged Parameter for Algorithm routinegenerated::UpdateBool
: Boolean if generated quantities should be generated while samplingiter::BaytesCore.Iterator
: Current iteration number
BaytesOptim.DiagnosticsLBFG
— Typestruct DiagnosticsLBFG <: OptimKernelDiagnostics
Diagnostics for LBFG.
Fields
BaytesOptim.DiagnosticsSGD
— Typestruct DiagnosticsSGD <: OptimKernelDiagnostics
Diagnostics for SGD.
Fields
BaytesOptim.LBFGTune
— Typestruct LBFGTune{R<:Real} <: BaytesCore.AbstractTune
Stores information used throughout optimization algorithms.
Fields
magnitude_penalty::Real
: Add-0.5 * magnitude_penalty * sum(abs2, q)
to the log posterior when finding the local optimum. This can help avoid getting into high-density edge areas of the posterior which are otherwise not typical (eg multilevel models).
iterations::Int64
: Maximum number of iterations in the optimization algorithm. Recall that we don't need to find the mode, or even a local mode, just be in a reasonable region.
BaytesOptim.OptimConstructor
— TypeCallable struct to make initializing Optimizer easier in sampling library.
Examples
BaytesOptim.OptimDefault
— Typestruct OptimDefault{T<:NamedTuple, G, I<:AbstractInitialization, U<:UpdateBool}
Default arguments for Optim constructor.
Fields
kernel::NamedTuple
: Tuning Arguments for individual OptimizerGradientBackend::Any
: Gradient backend used in Optimization step. Not used if Metropolis sampler is chosen.init::AbstractInitialization
: Method to obtain initial Modelparameter, see 'AbstractInitialization'.generated::UpdateBool
: Boolean if generate(_rng, objective) for corresponding model is stored in Optimization Diagnostics.
BaytesOptim.OptimTune
— Typestruct OptimTune{T<:ModelWrappers.Tagged, K, B<:UpdateBool} <: BaytesCore.AbstractTune
Stores information used throughout optimization algorithms.
Fields
tagged::ModelWrappers.Tagged
: Tagged Parameter for Optimization routinekernel::Any
: Tuning arguments for individual Optimizergenerated::UpdateBool
: Boolean if generated quantities should be generated while samplingiter::BaytesCore.Iterator
: Current iteration number
BaytesOptim.Optimizer
— Typestruct Optimizer{M<:OptimKernel, N<:OptimTune} <: BaytesCore.AbstractAlgorithm
Stores information for proposal step.
Fields
kernel::OptimKernel
: Optimizertune::OptimTune
: Tuning configuration for kernel.
BaytesOptim.SGDTune
— Typestruct SGDTune{R<:Real, A<:UpdateBool} <: BaytesCore.AbstractTune
Stores information used throughout optimization algorithms.
Fields
magnitude_penalty::Real
: Add-0.5 * magnitude_penalty * sum(abs2, q)
to the log posterior when finding the local optimum. This can help avoid getting into high-density edge areas of the posterior which are otherwise not typical (eg multilevel models).
magnitude_adaption::UpdateBool
: Adapt magnitude iteratively for each step ~ currently not implemented
iterations::Int64
: Maximum number of iterations in the optimization algorithm. Recall that we don't need to find the mode, or even a local mode, just be in a reasonable region.
BaytesCore.generate
— Methodgenerate(_rng, algorithm, objective)
Generate statistics for algorithm given model parameter and data.
Examples
BaytesCore.generate
— Methodgenerate(_rng, algorithm, objective)
Generate statistics for algorithm given model parameter and data.
Examples
BaytesCore.generate_showvalues
— Methodgenerate_showvalues(diagnostics)
Show relevant diagnostic results.
Examples
BaytesCore.generate_showvalues
— Methodgenerate_showvalues(diagnostics)
Show relevant diagnostic results.
Examples
BaytesCore.infer
— Methodinfer(_rng, algorithm, model, data)
Infer type of predictions of CustomAlgorithm sampler.
Examples
BaytesCore.infer
— Methodinfer(_rng, optimizer, model, data)
Infer type of predictions of Optim sampler.
Examples
BaytesCore.infer
— Methodinfer(_rng, diagnostics, algorithm, model, data)
Infer CustomAlgorithm diagnostics type.
Examples
BaytesCore.infer
— Methodinfer(_rng, diagnostics, optimizer, model, data)
Infer Optim diagnostics type.
Examples
BaytesCore.init
— Methodinit(, optim, objective; magnitude_penalty, iterations)
Initialize Mala custom configurations.
Examples
BaytesCore.init
— Methodinit(
,
optim,
objective;
magnitude_penalty,
magnitude_adaption,
iterations
)
Initialize Mala custom configurations.
Examples
BaytesCore.init
— Methodinit(, config, objective)
Initialize LBFG custom configurations.
Examples
BaytesCore.init
— Methodinit(, config, objective)
Initialize SGD custom configurations.
Examples
BaytesCore.propagate
— Methodpropagate(_rng, algorithm, objective)
Function to dispatch on objective if needed to be extended. Note that objective.model has to be updated manually with estimated parameter in this step
Examples
BaytesCore.propagate
— Methodpropagate(_rng, kernel, tune, objective)
Propagate forward one MALA step.
Examples
BaytesCore.propagate
— Methodpropagate(_rng, kernel, tune, objective)
Propagate forward one MALA step.
Examples
BaytesCore.propose!
— Methodpropose!(_rng, algorithm, model, data)
propose!(_rng, algorithm, model, data, proposaltune)
Inplace version of propose.
Examples
BaytesCore.propose!
— Methodpropose!(_rng, optim, model, data)
propose!(_rng, optim, model, data, proposaltune)
Inplace version of propose.
Examples
BaytesCore.propose
— Methodpropose(_rng, algorithm, objective)
Propose new parameter with Algorithm.
Examples
BaytesCore.propose
— Methodpropose(_rng, optim, objective)
Propose new parameter with optimizer. If update=true, objective function will be updated with input model and data.
Examples
BaytesCore.results
— Methodresults(diagnosticsᵛ, algorithm, Ndigits, quantiles)
Print result for a single trace.
Examples
BaytesCore.results
— Methodresults(diagnosticsᵛ, algorithm, Ndigits, quantiles)
Print result for a single trace.
Examples
BaytesCore.update!
— Methodupdate!(tune, result)
Update tuning fields at current iteration.
Examples
BaytesCore.update!
— Methodupdate!(tune, result)
Update Optim tuning fields at current iteration.
Examples
BaytesOptim._optimize
— FunctionInternal optimization function via 'Optim' and 'NLSolversBase' - both have to be loaded and are used as an Extension if used.
Examples
BaytesOptim.infer_generated
— Methodinfer_generated(_rng, algorithm, model, data)
Infer type of generated quantities of CustomAlgorithm.
Examples
BaytesOptim.infer_generated
— Methodinfer_generated(_rng, optimizer, model, data)
Infer type of generated quantities of Optimizer.
Examples