示例#1
0
 def kernel(rwm_state, seed):
   if not self._is_on_jax:
     rwm_seed = _test_seed()
   else:
     rwm_seed, seed = util.split_seed(seed, 2)
   rwm_state, rwm_extra = fun_mcmc.random_walk_metropolis(
       rwm_state,
       target_log_prob_fn=target_log_prob_fn,
       proposal_fn=proposal_fn,
       seed=rwm_seed)
   return (rwm_state, seed), rwm_extra
示例#2
0
 def kernel(rwm_state, seed):
     if backend.get_backend() == backend.TENSORFLOW:
         rwm_seed = tfp_test_util.test_seed()
     else:
         rwm_seed, seed = util.split_seed(seed, 2)
     rwm_state, rwm_extra = fun_mcmc.random_walk_metropolis(
         rwm_state,
         target_log_prob_fn=target_log_prob_fn,
         proposal_fn=proposal_fn,
         seed=rwm_seed)
     return (rwm_state, seed), rwm_extra