コード例 #1
0
def make_slow_adapt_kernel(*, kind, proposal_kernel_kwargs,
                           dual_averaging_kwargs, initial_running_variance):
    return dmma.DiagonalMassMatrixAdaptation(
        make_fast_adapt_kernel(kind=kind,
                               proposal_kernel_kwargs=proposal_kernel_kwargs,
                               dual_averaging_kwargs=dual_averaging_kwargs),
        initial_running_variance=initial_running_variance)
コード例 #2
0
def make_slow_adapt_kernel(*, target_log_prob_fn, initial_running_variance,
                           initial_step_size, num_leapfrog_steps,
                           num_adaptation_steps, target_accept_prob):
    return dmma.DiagonalMassMatrixAdaptation(
        make_fast_adapt_kernel(target_log_prob_fn=target_log_prob_fn,
                               initial_step_size=initial_step_size,
                               num_leapfrog_steps=num_leapfrog_steps,
                               num_adaptation_steps=num_adaptation_steps,
                               target_accept_prob=target_accept_prob,
                               momentum_distribution=None),
        initial_running_variance=initial_running_variance)