abcpmc icon indicating copy to clipboard operation
abcpmc copied to clipboard

Solution for pool.dists =[]

Open JinfengM opened this issue 3 years ago • 0 comments

When the code "eps.eps = np.percentile(pool.dists, alpha, axis=0) " raised a exception, this might because pool.dists is null. My solution is adding the following code: res = self.mapFunc(wrapper, range(self.N))

    res_thetas=copy.deepcopy(res)
    res_dists=copy.deepcopy(res)
    res_cnts=copy.deepcopy(res)
    
    #res = self.mapFunc(wrapper, range(self.N))
    
    thetas = np.array([theta for (theta, _, _) in res_thetas])
    print('thetas is : {0}'.format(thetas))

    dists = np.array([dist for (_, dist, _) in res_dists])
    print('dists is : {0}'.format(dists))

    cnts = np.sum([cnt for (_, _, cnt) in res_cnts])
    print('cnts is : {0}'.format(cnts))
    ws = np.ones(self.N) / self.N

the same for "res = self.mapFunc(particleProposal, range(self.N))"

JinfengM avatar Aug 12 '22 03:08 JinfengM