Closed YoshikawaMasashi closed 6 years ago
I added a unit test and refactor the code.
When I perform a unit test that use a list for latent_vars
of tf.float64
, an error occurs. So I fixed this bug.
Is it better that I also add unit tests in the same way for other MC (MetropolisHastings
and so on)?
Great! Merging.
Is it better that I also add unit tests in the same way for other MC (MetropolisHastings and so on)?
Absolutely.
Hi.
I implemented ReplicaExchangeMC in #865. But I found some errors and fixed.
multiple latent variables
A code which use multiple latent variables does not work, and this code does not work.
The cause for this is that callable which return a dict cannot be used in
tf.case
. The error occurs in this code. In this codereplica_sample[i]
is dict. (Exceptionally, It seem that a dict which has only one variable does work.)Therefore, I fixed this error. I implemented to calculate rates at each replica first. And
tf.case
is not used.list for `latent_vars`
When I use a list for
latent_vars
, an error occurs.In
super(ReplicaExchangeMC, self).__init__(latent_vars, data)
,latent_vars
(list) is converted tolatent_vars
(dict). But before this,latent_vars
(dict) is needed. I also fixed this.Thanks