'Create a lower bound in three parts, normalized reconstruction
cost, normalized KL divergence cost, and their sum.
Args:
post_zs: posterior z ~ q(z|x)
prior_z_process: prior AR(1) process'

def __init__(self, post_zs, prior_z_process):

    assert (len(post_zs) > 1), 'GP    is    for    time,    need    more    than    1    time    step.'
    assert isinstance(prior_z_process, GaussianProcess), 'Must    use    GP.'
    z0_bxu = post_zs[0].sample
    logq_bxu = post_zs[0].logp(z0_bxu)
    logp_bxu = prior_z_process.logp_t(z0_bxu)
    z_tm1_bxu = z0_bxu
    for z_t in post_zs[1:]:
        z_t_bxu = z_t.sample
        logq_bxu += z_t.logp(z_t_bxu)
        logp_bxu += prior_z_process.logp_t(z_t_bxu, z_tm1_bxu)
        z_tm1 = z_t_bxu
    kl_bxu = (logq_bxu - logp_bxu)
    kl_b = tf.reduce_sum(kl_bxu, [1])
    self.kl_cost_b = kl_b
    self.kl_cost = tf.reduce_mean(kl_b)
