Open b-remy opened 1 year ago
This PR contains copy pasted code from tensorflow-probability that I adapted to enable the following features:
tensorflow-probability
[batch_size, num_block, dim]
Here is an example of training 6 RealNVPs in parallel on 2-dimensional 2 moons:
Although the fit is not perfect due for Flow prior not necessarily centered, this can be used for NeuTra sampling:
ess_hmc = tfp.mcmc.effective_sample_size(tf.reshape(samples_hmc, [-1, 2])) print("ESS, HMC", sess.run(ess_hmc)) # ESS, HMC [600000. 410844.72] ess_neutra = tfp.mcmc.effective_sample_size(tf.reshape(samples_neutra, [-1, 2])) print("ESS, NeuTra", sess.run(ess_neutra)) # ESS, NeuTra [600000. 463283.94]
Colab does not support tensorflow 1 anymore so I uploaded the associated notebook on Gist.
This PR contains copy pasted code from
tensorflow-probability
that I adapted to enable the following features:[batch_size, num_block, dim]
. A RealNVP is created for each block.Here is an example of training 6 RealNVPs in parallel on 2-dimensional 2 moons:
Although the fit is not perfect due for Flow prior not necessarily centered, this can be used for NeuTra sampling:
Colab does not support tensorflow 1 anymore so I uploaded the associated notebook on Gist.