Using PT mcmcsampler: a demo

import numpy as np
import matplotlib.pyplot as plt
import pickle
import m3c2.proposal as proposal
from m3c2.sampler import PTSampler
from m3c2.tools import get_autocorr_len,  get_mcmc_stats

import multiprocessing as mp
mp.set_start_method('fork') #needed for MacOS

Define a log-likelihood function

Here we take a simple multi dimensional Gaussian. We use a class to easily store all the meta data needed to evaluate the log-likelihood

class TestLogLik:
    """ A multi dimensional Gaussian
    """
    def __init__(self, ndim):
        """ Init number of dimensions.
        """
        self.ndim = ndim
        self.param_dic = [f"p{i}" for i in range(ndim)]
        means = np.random.rand(ndim)
        cov = 0.5 - np.random.rand(ndim ** 2).reshape((ndim, ndim))
        cov = np.triu(cov)
        cov += cov.T - np.diag(cov.diagonal())
        cov = np.dot(cov, cov)
        self.mu = means
        self.cov = cov

    def loglik(self, x, **kwargs):
        """ Return log-likelihood for a given point x.
        """
        diff = x - self.mu
        return -0.5 * np.dot(diff, np.linalg.solve(self.cov, diff))

    def logpi(self, p, **kwargs):
        """ Return log-prior for a given point x.
        """
        return -7.0

Define the sampler

# Parallel tempering parameters
Tmax = 10
Nchains = 5

# Define likelihood, priors and starting point
ndim = 3
T = TestLogLik(ndim)
priors = np.array([-3,3]*T.ndim).reshape(T.ndim,2)
x0 = [np.random.randn(T.ndim) for n in range(Nchains)]

S = PTSampler(Nchains, T.loglik, T.logpi, T.param_dic, Tmax=Tmax, profiling=True)
S.set_starting_point(x0)
INFO:root:Tmax=10, range of temperature: [ 1.          1.77827941  3.16227766  5.62341325 10.        ]

Define the proposals

# Define proposals
SL = proposal.Slice(T.param_dic).slice
SC = proposal.SCAM(T.param_dic).SCAM
p_dict = [{SL:40, SC:70}]*Nchains
S.set_proposals(p_dict)

Run the sampler

# Run mcmc
niter = 1000
c = S.run_mcmc(niter, pSwap=0.95, printN=50, multiproc=True, n0_swap=100)
INFO:root:iter 0 chain 0
INFO:root:current loglik: -173.7, best: -173.7, temp: 1.0, ratio: 1.0
INFO:root:iter 0 chain 1
INFO:root:current loglik: -95.0, best: -95.0, temp: 1.8, ratio: 1.0
INFO:root:iter 0 chain 2
INFO:root:current loglik: -77.7, best: -77.7, temp: 3.2, ratio: 1.0
INFO:root:iter 0 chain 3
INFO:root:current loglik: -273.2, best: -273.2, temp: 5.6, ratio: 1.0
INFO:root:iter 50 chain 0
INFO:root:current loglik: -54.7, best: -54.6, temp: 1.0, ratio: 1.0
INFO:root:iter 0 chain 4
INFO:root:current loglik: -317.0, best: -317.0, temp: 10.0, ratio: 1.0
INFO:root:iter 50 chain 1
INFO:root:current loglik: -31.9, best: -29.2, temp: 1.8, ratio: 1.0
INFO:root:iter 50 chain 3
INFO:root:current loglik: -20.5, best: -3.6, temp: 5.6, ratio: 1.0
INFO:root:iter 100 chain 1
INFO:root:current loglik: -9.1, best: -8.9, temp: 1.8, ratio: 1.0
INFO:root:iter 50 chain 2
INFO:root:current loglik: -13.0, best: -12.0, temp: 3.2, ratio: 1.0
INFO:root:iter 100 chain 0
INFO:root:current loglik: -9.8, best: -8.0, temp: 1.0, ratio: 1.0
INFO:root:iter 50 chain 4
INFO:root:current loglik: -150.3, best: -145.4, temp: 10.0, ratio: 1.0
INFO:root:iter 100 chain 3
INFO:root:current loglik: -7.7, best: -2.3, temp: 5.6, ratio: 1.0
INFO:root:iter 100 chain 2
INFO:root:current loglik: -0.9, best: -0.8, temp: 3.2, ratio: 1.0
INFO:root:iter 100 chain 4
INFO:root:current loglik: -2.9, best: -2.9, temp: 10.0, ratio: 1.0
INFO:root:iter 150 chain 0
INFO:root:current loglik: -2.8, best: -0.9, temp: 1.0, ratio: 0.6595744680851063
INFO:root:iter 150 chain 1
INFO:root:current loglik: -1.2, best: -0.9, temp: 1.8, ratio: 0.5
INFO:root:iter 150 chain 2
INFO:root:current loglik: -14.5, best: -0.8, temp: 3.1, ratio: 0.8333333333333334
INFO:root:iter 150 chain 3
INFO:root:current loglik: -22.2, best: -0.9, temp: 5.6, ratio: 0.8723404255319149
INFO:root:iter 150 chain 4
INFO:root:current loglik: -22.2, best: -2.8, temp: 10.0, ratio: 1.0
INFO:root:iter 200 chain 0
INFO:root:current loglik: -1.2, best: -0.8, temp: 1.0, ratio: 0.5934065934065934
INFO:root:iter 200 chain 1
INFO:root:current loglik: -4.1, best: -0.9, temp: 1.8, ratio: 0.29896907216494845
INFO:root:iter 200 chain 2
INFO:root:current loglik: -6.3, best: -0.8, temp: 3.1, ratio: 0.7916666666666666
INFO:root:iter 200 chain 3
INFO:root:current loglik: -6.2, best: -0.9, temp: 5.6, ratio: 0.9368421052631579
INFO:root:iter 200 chain 4
INFO:root:current loglik: -6.2, best: -2.8, temp: 10.0, ratio: 1.0
INFO:root:iter 250 chain 0
INFO:root:current loglik: -0.5, best: -0.3, temp: 1.0, ratio: 0.562962962962963
INFO:root:iter 250 chain 1
INFO:root:current loglik: -15.6, best: -0.4, temp: 1.8, ratio: 0.3356164383561644
INFO:root:iter 250 chain 2
INFO:root:current loglik: -15.7, best: -0.8, temp: 3.1, ratio: 0.8111888111888111
INFO:root:iter 250 chain 3
INFO:root:current loglik: -15.1, best: -0.7, temp: 5.5, ratio: 0.9440559440559441
INFO:root:iter 250 chain 4
INFO:root:current loglik: -15.1, best: -2.8, temp: 10.0, ratio: 1.0
INFO:root:iter 300 chain 0
INFO:root:current loglik: -7.2, best: -0.0, temp: 1.0, ratio: 0.5111111111111111
INFO:root:iter 300 chain 1
INFO:root:current loglik: -7.7, best: -0.4, temp: 1.8, ratio: 0.4564102564102564
INFO:root:iter 300 chain 2
INFO:root:current loglik: -5.8, best: -0.8, temp: 3.1, ratio: 0.8473684210526315
INFO:root:iter 300 chain 3
INFO:root:current loglik: -8.2, best: -0.7, temp: 5.5, ratio: 0.9368421052631579
INFO:root:iter 300 chain 4
INFO:root:current loglik: -33.9, best: -2.8, temp: 10.0, ratio: 1.0
INFO:root:iter 350 chain 0
INFO:root:current loglik: -5.0, best: -0.0, temp: 1.0, ratio: 0.5131578947368421
INFO:root:iter 350 chain 1
INFO:root:current loglik: -2.1, best: -0.4, temp: 1.8, ratio: 0.47520661157024796
INFO:root:iter 350 chain 2
INFO:root:current loglik: -3.8, best: -0.8, temp: 3.1, ratio: 0.7866108786610879
INFO:root:iter 350 chain 3
INFO:root:current loglik: -1.1, best: -0.7, temp: 5.4, ratio: 0.8686440677966102
INFO:root:iter 350 chain 4
INFO:root:current loglik: -4.7, best: -2.8, temp: 10.0, ratio: 1.0
INFO:root:iter 400 chain 0
INFO:root:current loglik: -2.0, best: -0.0, temp: 1.0, ratio: 0.5437956204379562
INFO:root:iter 400 chain 1
INFO:root:current loglik: -1.8, best: -0.0, temp: 1.8, ratio: 0.5051546391752577
INFO:root:iter 400 chain 2
INFO:root:current loglik: -3.1, best: -0.2, temp: 3.1, ratio: 0.794425087108014
INFO:root:iter 400 chain 3
INFO:root:current loglik: -3.8, best: -0.2, temp: 5.4, ratio: 0.8861209964412812
INFO:root:iter 400 chain 4
INFO:root:current loglik: -3.8, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 450 chain 0
INFO:root:current loglik: -4.8, best: -0.0, temp: 1.0, ratio: 0.5389408099688473
INFO:root:iter 450 chain 1
INFO:root:current loglik: -11.5, best: -0.0, temp: 1.8, ratio: 0.5219941348973607
INFO:root:iter 450 chain 2
INFO:root:current loglik: -14.0, best: -0.2, temp: 3.1, ratio: 0.7774480712166172
INFO:root:iter 450 chain 3
INFO:root:current loglik: -14.0, best: -0.2, temp: 5.3, ratio: 0.8871951219512195
INFO:root:iter 450 chain 4
INFO:root:current loglik: -14.0, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 500 chain 0
INFO:root:current loglik: -4.2, best: -0.0, temp: 1.0, ratio: 0.49184782608695654
INFO:root:iter 500 chain 1
INFO:root:current loglik: -4.0, best: -0.0, temp: 1.8, ratio: 0.5358974358974359
INFO:root:iter 500 chain 2
INFO:root:current loglik: -4.2, best: -0.2, temp: 3.1, ratio: 0.7604166666666666
INFO:root:iter 500 chain 3
INFO:root:current loglik: -4.4, best: -0.2, temp: 5.3, ratio: 0.8962765957446809
INFO:root:iter 500 chain 4
INFO:root:current loglik: -4.0, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 550 chain 0
INFO:root:current loglik: -1.8, best: -0.0, temp: 1.0, ratio: 0.513189448441247
INFO:root:iter 550 chain 1
INFO:root:current loglik: -2.7, best: -0.0, temp: 1.8, ratio: 0.5727272727272728
INFO:root:iter 550 chain 2
INFO:root:current loglik: -7.0, best: -0.2, temp: 3.1, ratio: 0.7777777777777778
INFO:root:iter 550 chain 3
INFO:root:current loglik: -6.9, best: -0.2, temp: 5.3, ratio: 0.8957345971563981
INFO:root:iter 550 chain 4
INFO:root:current loglik: -6.9, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 600 chain 0
INFO:root:current loglik: -3.4, best: -0.0, temp: 1.0, ratio: 0.531317494600432
INFO:root:iter 600 chain 1
INFO:root:current loglik: -5.1, best: -0.0, temp: 1.8, ratio: 0.5708418891170431
INFO:root:iter 600 chain 2
INFO:root:current loglik: -10.7, best: -0.2, temp: 3.1, ratio: 0.7677824267782427
INFO:root:iter 600 chain 3
INFO:root:current loglik: -24.0, best: -0.2, temp: 5.2, ratio: 0.8696581196581197
INFO:root:iter 600 chain 4
INFO:root:current loglik: -60.0, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 650 chain 0
INFO:root:current loglik: -1.6, best: -0.0, temp: 1.0, ratio: 0.5442043222003929
INFO:root:iter 650 chain 1
INFO:root:current loglik: -0.5, best: -0.0, temp: 1.8, ratio: 0.5572232645403377
INFO:root:iter 650 chain 2
INFO:root:current loglik: -25.0, best: -0.2, temp: 3.1, ratio: 0.7257142857142858
INFO:root:iter 650 chain 3
INFO:root:current loglik: -24.1, best: -0.2, temp: 5.2, ratio: 0.8197674418604651
INFO:root:iter 650 chain 4
INFO:root:current loglik: -53.5, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 700 chain 0
INFO:root:current loglik: -1.8, best: -0.0, temp: 1.0, ratio: 0.5539568345323741
INFO:root:iter 700 chain 1
INFO:root:current loglik: -3.6, best: -0.0, temp: 1.8, ratio: 0.5111876075731497
INFO:root:iter 700 chain 2
INFO:root:current loglik: -27.7, best: -0.2, temp: 3.0, ratio: 0.7382198952879581
INFO:root:iter 700 chain 3
INFO:root:current loglik: -27.7, best: -0.2, temp: 5.2, ratio: 0.8241563055062167
INFO:root:iter 700 chain 4
INFO:root:current loglik: -27.7, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 750 chain 0
INFO:root:current loglik: -0.2, best: -0.0, temp: 1.0, ratio: 0.5537190082644629
INFO:root:iter 750 chain 1
INFO:root:current loglik: -1.4, best: -0.0, temp: 1.8, ratio: 0.47385103011093505
INFO:root:iter 750 chain 2
INFO:root:current loglik: -9.7, best: -0.2, temp: 3.0, ratio: 0.7278582930756844
INFO:root:iter 750 chain 3
INFO:root:current loglik: -18.7, best: -0.2, temp: 5.1, ratio: 0.8243021346469622
INFO:root:iter 750 chain 4
INFO:root:current loglik: -19.9, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 800 chain 0
INFO:root:current loglik: -1.7, best: -0.0, temp: 1.0, ratio: 0.5696784073506891
INFO:root:iter 800 chain 1
INFO:root:current loglik: -1.4, best: -0.0, temp: 1.8, ratio: 0.4698085419734904
INFO:root:iter 800 chain 2
INFO:root:current loglik: -4.3, best: -0.2, temp: 3.0, ratio: 0.7290419161676647
INFO:root:iter 800 chain 3
INFO:root:current loglik: -16.3, best: -0.2, temp: 5.1, ratio: 0.8307926829268293
INFO:root:iter 800 chain 4
INFO:root:current loglik: -16.3, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 850 chain 0
INFO:root:current loglik: -12.7, best: -0.0, temp: 1.0, ratio: 0.5665236051502146
INFO:root:iter 850 chain 1
INFO:root:current loglik: -15.4, best: -0.0, temp: 1.8, ratio: 0.4786795048143054
INFO:root:iter 850 chain 2
INFO:root:current loglik: -13.8, best: -0.2, temp: 3.0, ratio: 0.7192737430167597
INFO:root:iter 850 chain 3
INFO:root:current loglik: -12.8, best: -0.2, temp: 5.1, ratio: 0.8373751783166904
INFO:root:iter 850 chain 4
INFO:root:current loglik: -12.8, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 900 chain 0
INFO:root:current loglik: -3.4, best: -0.0, temp: 1.0, ratio: 0.5518169582772544
INFO:root:iter 900 chain 1
INFO:root:current loglik: -2.5, best: -0.0, temp: 1.8, ratio: 0.4766233766233766
INFO:root:iter 900 chain 2
INFO:root:current loglik: -19.4, best: -0.2, temp: 3.0, ratio: 0.7028795811518325
INFO:root:iter 900 chain 3
INFO:root:current loglik: -19.2, best: -0.2, temp: 5.1, ratio: 0.8299866131191432
INFO:root:iter 900 chain 4
INFO:root:current loglik: -19.2, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:iter 950 chain 0
INFO:root:current loglik: -1.8, best: -0.0, temp: 1.0, ratio: 0.541191381495564
INFO:root:iter 950 chain 1
INFO:root:current loglik: -0.2, best: -0.0, temp: 1.8, ratio: 0.4682151589242054
INFO:root:iter 950 chain 2
INFO:root:current loglik: -15.7, best: -0.2, temp: 3.0, ratio: 0.7160493827160493
INFO:root:iter 950 chain 3
INFO:root:current loglik: -17.7, best: -0.2, temp: 5.1, ratio: 0.8375314861460957
INFO:root:iter 950 chain 4
INFO:root:current loglik: -17.7, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:Temperature ladder adjustment processus is done
INFO:root:iter 999 chain 0
INFO:root:current loglik: -1.9, best: -0.0, temp: 1.0, ratio: 0.5155875299760192
INFO:root:iter 999 chain 1
INFO:root:current loglik: -11.6, best: -0.0, temp: 1.8, ratio: 0.4699074074074074
INFO:root:iter 999 chain 2
INFO:root:current loglik: -11.9, best: -0.2, temp: 3.0, ratio: 0.7237762237762237
INFO:root:iter 999 chain 3
INFO:root:current loglik: -20.9, best: -0.2, temp: 5.0, ratio: 0.8420427553444181
INFO:root:iter 999 chain 4
INFO:root:current loglik: -20.9, best: -0.3, temp: 10.0, ratio: 1.0
INFO:root:Done !

Show posterior for 1st parameter

# Plot distribution of first parameter
#C0 = np.array(S.chains[0].chn)
C0 = np.load("chain_0.npy")
plt.figure()
plt.hist(C0["p0"],  bins=100, color="k", histtype="step")
plt.axvline(x=T.mu[0], label='True')
plt.legend()
<matplotlib.legend.Legend at 0x7f147ffb0880>
png

Show likelihood evolution

L = np.load("chain_0.npy")['logL']
P = np.load("chain_0.npy")['logP']
plt.figure()
plt.plot(L, label="log-lik")
plt.plot(P, label="log-prob")
plt.legend()
<matplotlib.legend.Legend at 0x7f14f89fab80>
png

Show statistics

jumps_t, ar_t, nswap = get_mcmc_stats('./', p_dict)
full_names = jumps_t.dtype.names

Acceptance rate for each proposals

plt.figure(figsize=(10,5))
plt.subplot(121)
y_offset = np.zeros((Nchains))
for n in full_names:
    plt.bar(np.arange(0, Nchains), height=ar_t[n]/jumps_t[n], bottom=y_offset, label=n)
    y_offset += ar_t[n]/jumps_t[n]
plt.legend()
plt.ylabel("# accepted / # jumps")

plt.subplot(122)
y_offset = np.zeros((Nchains))
for n in full_names:
    plt.bar(np.arange(0, Nchains), height=ar_t[n], bottom=y_offset, label=n)
    y_offset += ar_t[n]
plt.legend()
plt.ylabel("Number of MH steps")
Text(0, 0.5, 'Number of MH steps')
png

Swap statistics

plt.figure()
plt.bar(np.arange(0, 2*Nchains-2, 2), height=nswap[:-1,1], label="proposed")
plt.bar(np.arange(1, 2*Nchains-1, 2), height=nswap[:-1,0], label="accepted")
plt.ylabel("# accepted swap vs # proposed")
plt.legend()
<matplotlib.legend.Legend at 0x7f14f86ac610>
png

Resume sampler

chain_fn = "chain_0.npy"

S2 = PTSampler(Nchains, T.loglik, T.logpi, T.param_dic, Tmax=Tmax, profiling=True)
S2.set_proposals(p_dict)
S2.resume([chain_fn])
c = S2.run_mcmc(niter, pSwap=0.95, printN=50, multiproc=True, n0_swap=100)
INFO:root:Tmax=10, range of temperature: [ 1.          1.77827941  3.16227766  5.62341325 10.        ]
INFO:root:iter 0 chain 0
INFO:root:current loglik: -4.2, best: -0.0, temp: 1.0, ratio: 1.0
INFO:root:iter 0 chain 1
INFO:root:current loglik: -4.2, best: -0.0, temp: 1.8, ratio: 1.0
INFO:root:iter 0 chain 2
INFO:root:current loglik: -4.2, best: -0.0, temp: 3.2, ratio: 1.0
INFO:root:iter 50 chain 0
INFO:root:current loglik: -1.7, best: -0.0, temp: 1.0, ratio: 1.0
INFO:root:iter 50 chain 1
INFO:root:current loglik: -0.5, best: -0.0, temp: 1.8, ratio: 1.0
INFO:root:iter 0 chain 3
INFO:root:current loglik: -4.2, best: -0.0, temp: 5.6, ratio: 1.0
INFO:root:iter 50 chain 2
INFO:root:current loglik: -1.4, best: -0.0, temp: 3.2, ratio: 1.0
INFO:root:iter 0 chain 4
INFO:root:current loglik: -4.2, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 100 chain 0
INFO:root:current loglik: -2.0, best: -0.0, temp: 1.0, ratio: 1.0
INFO:root:iter 100 chain 1
INFO:root:current loglik: -2.1, best: -0.0, temp: 1.8, ratio: 1.0
INFO:root:iter 50 chain 3
INFO:root:current loglik: -13.7, best: -0.0, temp: 5.6, ratio: 1.0
INFO:root:iter 100 chain 2
INFO:root:current loglik: -12.0, best: -0.0, temp: 3.2, ratio: 1.0
INFO:root:iter 50 chain 4
INFO:root:current loglik: -17.4, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 100 chain 3
INFO:root:current loglik: -5.8, best: -0.0, temp: 5.6, ratio: 1.0
INFO:root:iter 100 chain 4
INFO:root:current loglik: -25.1, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 150 chain 0
INFO:root:current loglik: -1.3, best: -0.0, temp: 1.0, ratio: 0.4782608695652174
INFO:root:iter 150 chain 1
INFO:root:current loglik: -1.2, best: -0.0, temp: 1.8, ratio: 0.7755102040816326
INFO:root:iter 150 chain 2
INFO:root:current loglik: -0.5, best: -0.0, temp: 3.2, ratio: 0.74
INFO:root:iter 150 chain 3
INFO:root:current loglik: -4.4, best: -0.0, temp: 5.6, ratio: 0.8085106382978723
INFO:root:iter 150 chain 4
INFO:root:current loglik: -4.4, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 200 chain 0
INFO:root:current loglik: -2.8, best: -0.0, temp: 1.0, ratio: 0.45161290322580644
INFO:root:iter 200 chain 1
INFO:root:current loglik: -8.9, best: -0.0, temp: 1.8, ratio: 0.7052631578947368
INFO:root:iter 200 chain 2
INFO:root:current loglik: -10.1, best: -0.0, temp: 3.1, ratio: 0.5979381443298969
INFO:root:iter 200 chain 3
INFO:root:current loglik: -66.1, best: -0.0, temp: 5.6, ratio: 0.7052631578947368
INFO:root:iter 200 chain 4
INFO:root:current loglik: -66.1, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 250 chain 0
INFO:root:current loglik: -2.3, best: -0.0, temp: 1.0, ratio: 0.48936170212765956
INFO:root:iter 250 chain 1
INFO:root:current loglik: -2.2, best: -0.0, temp: 1.8, ratio: 0.6319444444444444
INFO:root:iter 250 chain 2
INFO:root:current loglik: -11.3, best: -0.0, temp: 3.1, ratio: 0.5174825174825175
INFO:root:iter 250 chain 3
INFO:root:current loglik: -16.8, best: -0.0, temp: 5.5, ratio: 0.75
INFO:root:iter 250 chain 4
INFO:root:current loglik: -16.8, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 300 chain 0
INFO:root:current loglik: -4.7, best: -0.0, temp: 1.0, ratio: 0.49473684210526314
INFO:root:iter 300 chain 1
INFO:root:current loglik: -5.9, best: -0.0, temp: 1.8, ratio: 0.6178010471204188
INFO:root:iter 300 chain 2
INFO:root:current loglik: -7.7, best: -0.0, temp: 3.1, ratio: 0.5925925925925926
INFO:root:iter 300 chain 3
INFO:root:current loglik: -7.1, best: -0.0, temp: 5.5, ratio: 0.765625
INFO:root:iter 300 chain 4
INFO:root:current loglik: -7.1, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 350 chain 0
INFO:root:current loglik: -0.3, best: -0.0, temp: 1.0, ratio: 0.5504201680672269
INFO:root:iter 350 chain 1
INFO:root:current loglik: -0.8, best: -0.0, temp: 1.8, ratio: 0.6234309623430963
INFO:root:iter 350 chain 2
INFO:root:current loglik: -0.3, best: -0.0, temp: 3.1, ratio: 0.5941422594142259
INFO:root:iter 350 chain 3
INFO:root:current loglik: -6.4, best: -0.0, temp: 5.5, ratio: 0.7721518987341772
INFO:root:iter 350 chain 4
INFO:root:current loglik: -6.4, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 400 chain 0
INFO:root:current loglik: -2.2, best: -0.0, temp: 1.0, ratio: 0.5629370629370629
INFO:root:iter 400 chain 1
INFO:root:current loglik: -9.6, best: -0.0, temp: 1.8, ratio: 0.6366782006920415
INFO:root:iter 400 chain 2
INFO:root:current loglik: -1.2, best: -0.0, temp: 3.1, ratio: 0.573943661971831
INFO:root:iter 400 chain 3
INFO:root:current loglik: -37.2, best: -0.0, temp: 5.4, ratio: 0.7789473684210526
INFO:root:iter 400 chain 4
INFO:root:current loglik: -37.2, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 450 chain 0
INFO:root:current loglik: -0.8, best: -0.0, temp: 1.0, ratio: 0.573134328358209
INFO:root:iter 450 chain 1
INFO:root:current loglik: -9.2, best: -0.0, temp: 1.7, ratio: 0.6301775147928994
INFO:root:iter 450 chain 2
INFO:root:current loglik: -5.4, best: -0.0, temp: 3.1, ratio: 0.5105105105105106
INFO:root:iter 450 chain 3
INFO:root:current loglik: -11.4, best: -0.0, temp: 5.4, ratio: 0.7507507507507507
INFO:root:iter 450 chain 4
INFO:root:current loglik: -11.4, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 500 chain 0
INFO:root:current loglik: -1.9, best: -0.0, temp: 1.0, ratio: 0.5613577023498695
INFO:root:iter 500 chain 1
INFO:root:current loglik: -0.5, best: -0.0, temp: 1.7, ratio: 0.6391752577319587
INFO:root:iter 500 chain 2
INFO:root:current loglik: -1.8, best: -0.0, temp: 3.1, ratio: 0.5275590551181102
INFO:root:iter 500 chain 3
INFO:root:current loglik: -7.6, best: -0.0, temp: 5.4, ratio: 0.7597911227154047
INFO:root:iter 500 chain 4
INFO:root:current loglik: -7.6, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 550 chain 0
INFO:root:current loglik: -2.4, best: -0.0, temp: 1.0, ratio: 0.568445475638051
INFO:root:iter 550 chain 1
INFO:root:current loglik: -2.3, best: -0.0, temp: 1.7, ratio: 0.6336405529953917
INFO:root:iter 550 chain 2
INFO:root:current loglik: -2.6, best: -0.0, temp: 3.1, ratio: 0.5511627906976744
INFO:root:iter 550 chain 3
INFO:root:current loglik: -8.0, best: -0.0, temp: 5.4, ratio: 0.7587006960556845
INFO:root:iter 550 chain 4
INFO:root:current loglik: -8.0, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 600 chain 0
INFO:root:current loglik: -1.4, best: -0.0, temp: 1.0, ratio: 0.5627615062761506
INFO:root:iter 600 chain 1
INFO:root:current loglik: -9.0, best: -0.0, temp: 1.7, ratio: 0.6273291925465838
INFO:root:iter 600 chain 2
INFO:root:current loglik: -17.7, best: -0.0, temp: 3.1, ratio: 0.5690376569037657
INFO:root:iter 600 chain 3
INFO:root:current loglik: -14.1, best: -0.0, temp: 5.4, ratio: 0.775
INFO:root:iter 600 chain 4
INFO:root:current loglik: -14.1, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 650 chain 0
INFO:root:current loglik: -0.4, best: -0.0, temp: 1.0, ratio: 0.5428571428571428
INFO:root:iter 650 chain 1
INFO:root:current loglik: -3.8, best: -0.0, temp: 1.7, ratio: 0.623352165725047
INFO:root:iter 650 chain 2
INFO:root:current loglik: -6.9, best: -0.0, temp: 3.1, ratio: 0.5627376425855514
INFO:root:iter 650 chain 3
INFO:root:current loglik: -2.9, best: -0.0, temp: 5.4, ratio: 0.7419354838709677
INFO:root:iter 650 chain 4
INFO:root:current loglik: -11.2, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 700 chain 0
INFO:root:current loglik: -0.8, best: -0.0, temp: 1.0, ratio: 0.5619546247818499
INFO:root:iter 700 chain 1
INFO:root:current loglik: -1.5, best: -0.0, temp: 1.7, ratio: 0.6197916666666666
INFO:root:iter 700 chain 2
INFO:root:current loglik: -15.1, best: -0.0, temp: 3.1, ratio: 0.5721739130434783
INFO:root:iter 700 chain 3
INFO:root:current loglik: -53.8, best: -0.0, temp: 5.4, ratio: 0.7452006980802792
INFO:root:iter 700 chain 4
INFO:root:current loglik: -53.8, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 750 chain 0
INFO:root:current loglik: -3.2, best: -0.0, temp: 1.0, ratio: 0.5571658615136876
INFO:root:iter 750 chain 1
INFO:root:current loglik: -5.0, best: -0.0, temp: 1.7, ratio: 0.5936
INFO:root:iter 750 chain 2
INFO:root:current loglik: -27.4, best: -0.0, temp: 3.1, ratio: 0.5725806451612904
INFO:root:iter 750 chain 3
INFO:root:current loglik: -24.5, best: -0.0, temp: 5.3, ratio: 0.7309562398703403
INFO:root:iter 750 chain 4
INFO:root:current loglik: -24.5, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 800 chain 0
INFO:root:current loglik: -2.6, best: -0.0, temp: 1.0, ratio: 0.5552238805970149
INFO:root:iter 800 chain 1
INFO:root:current loglik: -0.9, best: -0.0, temp: 1.7, ratio: 0.563338301043219
INFO:root:iter 800 chain 2
INFO:root:current loglik: -12.2, best: -0.0, temp: 3.1, ratio: 0.5703592814371258
INFO:root:iter 800 chain 3
INFO:root:current loglik: -44.3, best: -0.0, temp: 5.3, ratio: 0.7346326836581709
INFO:root:iter 800 chain 4
INFO:root:current loglik: -44.3, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 850 chain 0
INFO:root:current loglik: -1.1, best: -0.0, temp: 1.0, ratio: 0.5571030640668524
INFO:root:iter 850 chain 1
INFO:root:current loglik: -1.0, best: -0.0, temp: 1.7, ratio: 0.5571030640668524
INFO:root:iter 850 chain 2
INFO:root:current loglik: -5.3, best: -0.0, temp: 3.1, ratio: 0.5377094972067039
INFO:root:iter 850 chain 3
INFO:root:current loglik: -18.0, best: -0.0, temp: 5.3, ratio: 0.7210599721059973
INFO:root:iter 850 chain 4
INFO:root:current loglik: -18.0, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 900 chain 0
INFO:root:current loglik: -2.2, best: -0.0, temp: 1.0, ratio: 0.5475880052151239
INFO:root:iter 900 chain 1
INFO:root:current loglik: -1.5, best: -0.0, temp: 1.7, ratio: 0.5532194480946123
INFO:root:iter 900 chain 2
INFO:root:current loglik: -3.2, best: -0.0, temp: 3.1, ratio: 0.5424836601307189
INFO:root:iter 900 chain 3
INFO:root:current loglik: -1.1, best: -0.0, temp: 5.3, ratio: 0.7284595300261096
INFO:root:iter 900 chain 4
INFO:root:current loglik: -1.1, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:iter 950 chain 0
INFO:root:current loglik: -4.2, best: -0.0, temp: 1.0, ratio: 0.547911547911548
INFO:root:iter 950 chain 1
INFO:root:current loglik: -3.3, best: -0.0, temp: 1.7, ratio: 0.5675340768277571
INFO:root:iter 950 chain 2
INFO:root:current loglik: -4.8, best: -0.0, temp: 3.1, ratio: 0.5644171779141104
INFO:root:iter 950 chain 3
INFO:root:current loglik: -4.6, best: -0.0, temp: 5.3, ratio: 0.7348951911220715
INFO:root:iter 950 chain 4
INFO:root:current loglik: -4.6, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:Temperature ladder adjustment processus is done
INFO:root:iter 999 chain 0
INFO:root:current loglik: -3.6, best: -0.0, temp: 1.0, ratio: 0.5440835266821346
INFO:root:iter 999 chain 1
INFO:root:current loglik: -3.4, best: -0.0, temp: 1.7, ratio: 0.5689252336448598
INFO:root:iter 999 chain 2
INFO:root:current loglik: -2.0, best: -0.0, temp: 3.1, ratio: 0.5627906976744186
INFO:root:iter 999 chain 3
INFO:root:current loglik: -2.5, best: -0.0, temp: 5.3, ratio: 0.7306791569086651
INFO:root:iter 999 chain 4
INFO:root:current loglik: -2.5, best: -0.0, temp: 10.0, ratio: 1.0
INFO:root:Done !