tfp.mcmc.default_exchange_proposed_fn(prob_exchange)
Default exchange proposal function, for replica exchange MC.
With probability prob_exchange
propose combinations of replica for exchange.
When exchanging, create combinations of adjacent replicas in
Replica Exchange Monte Carlo
exchange_fn = default_exchange_proposed_fn(prob_exchange=0.5)
exchange_proposed = exchange_fn(num_replica=3)
exchange_proposed.eval()
==> [[0, 1]] # 1 exchange, 0 <--> 1
exchange_proposed.eval()
==> [] # 0 exchanges
Args:
prob_exchange
: ScalarTensor
giving probability that any exchanges will be generated.
Returns:
default_exchange_proposed_fn_
: Python callable which take a number of replicas (a Python integer), and return combinations of replicas for exchange as an [n, 2] integerTensor
,0 <= n <= num_replica // 2
, with unique values in the set{0, ..., num_replica}
.