BaytesOptim.ConfigLBFGType
struct 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.ConfigSGDType
struct 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.CustomAlgorithmType
mutable struct CustomAlgorithm{R<:BaytesDiff.ℓDensityResult, T<:CustomAlgorithmTune} <: BaytesCore.AbstractAlgorithm

Stores information for proposal step.

Fields

  • result::BaytesDiff.ℓDensityResult

  • tune::CustomAlgorithmTune

BaytesOptim.CustomAlgorithmDefaultType
struct 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.CustomAlgorithmTuneType
struct CustomAlgorithmTune{T<:ModelWrappers.Tagged, B<:UpdateBool} <: BaytesCore.AbstractTune

Stores information used throughout custom algorithm.

Fields

  • tagged::ModelWrappers.Tagged: Tagged Parameter for Algorithm routine

  • generated::UpdateBool: Boolean if generated quantities should be generated while sampling

  • iter::BaytesCore.Iterator: Current iteration number

BaytesOptim.LBFGTuneType
struct 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.OptimDefaultType
struct OptimDefault{T<:NamedTuple, G, I<:AbstractInitialization, U<:UpdateBool}

Default arguments for Optim constructor.

Fields

  • kernel::NamedTuple: Tuning Arguments for individual Optimizer

  • GradientBackend::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.OptimTuneType
struct OptimTune{T<:ModelWrappers.Tagged, K, B<:UpdateBool} <: BaytesCore.AbstractTune

Stores information used throughout optimization algorithms.

Fields

  • tagged::ModelWrappers.Tagged: Tagged Parameter for Optimization routine

  • kernel::Any: Tuning arguments for individual Optimizer

  • generated::UpdateBool: Boolean if generated quantities should be generated while sampling

  • iter::BaytesCore.Iterator: Current iteration number

BaytesOptim.OptimizerType
struct Optimizer{M<:OptimKernel, N<:OptimTune} <: BaytesCore.AbstractAlgorithm

Stores information for proposal step.

Fields

  • kernel::OptimKernel: Optimizer

  • tune::OptimTune: Tuning configuration for kernel.

BaytesOptim.SGDTuneType
struct 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.generateMethod
generate(_rng, algorithm, objective)

Generate statistics for algorithm given model parameter and data.

Examples

BaytesCore.generateMethod
generate(_rng, algorithm, objective)

Generate statistics for algorithm given model parameter and data.

Examples

BaytesCore.inferMethod
infer(_rng, algorithm, model, data)

Infer type of predictions of CustomAlgorithm sampler.

Examples

BaytesCore.inferMethod
infer(_rng, optimizer, model, data)

Infer type of predictions of Optim sampler.

Examples

BaytesCore.inferMethod
infer(_rng, diagnostics, algorithm, model, data)

Infer CustomAlgorithm diagnostics type.

Examples

BaytesCore.inferMethod
infer(_rng, diagnostics, optimizer, model, data)

Infer Optim diagnostics type.

Examples

BaytesCore.initMethod
init(, optim, objective; magnitude_penalty, iterations)

Initialize Mala custom configurations.

Examples

BaytesCore.initMethod
init(
    ,
    optim,
    objective;
    magnitude_penalty,
    magnitude_adaption,
    iterations
)

Initialize Mala custom configurations.

Examples

BaytesCore.initMethod
init(, config, objective)

Initialize LBFG custom configurations.

Examples

BaytesCore.initMethod
init(, config, objective)

Initialize SGD custom configurations.

Examples

BaytesCore.propagateMethod
propagate(_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.propagateMethod
propagate(_rng, kernel, tune, objective)

Propagate forward one MALA step.

Examples

BaytesCore.propagateMethod
propagate(_rng, kernel, tune, objective)

Propagate forward one MALA step.

Examples

BaytesCore.propose!Method
propose!(_rng, algorithm, model, data)
propose!(_rng, algorithm, model, data, proposaltune)

Inplace version of propose.

Examples

BaytesCore.propose!Method
propose!(_rng, optim, model, data)
propose!(_rng, optim, model, data, proposaltune)

Inplace version of propose.

Examples

BaytesCore.proposeMethod
propose(_rng, algorithm, objective)

Propose new parameter with Algorithm.

Examples

BaytesCore.proposeMethod
propose(_rng, optim, objective)

Propose new parameter with optimizer. If update=true, objective function will be updated with input model and data.

Examples

BaytesCore.resultsMethod
results(diagnosticsᵛ, algorithm, Ndigits, quantiles)

Print result for a single trace.

Examples

BaytesCore.resultsMethod
results(diagnosticsᵛ, algorithm, Ndigits, quantiles)

Print result for a single trace.

Examples

BaytesCore.update!Method
update!(tune, result)

Update tuning fields at current iteration.

Examples

BaytesCore.update!Method
update!(tune, result)

Update Optim tuning fields at current iteration.

Examples

BaytesOptim._optimizeFunction

Internal optimization function via 'Optim' and 'NLSolversBase' - both have to be loaded and are used as an Extension if used.

Examples

BaytesOptim.infer_generatedMethod
infer_generated(_rng, algorithm, model, data)

Infer type of generated quantities of CustomAlgorithm.

Examples

BaytesOptim.infer_generatedMethod
infer_generated(_rng, optimizer, model, data)

Infer type of generated quantities of Optimizer.

Examples