How to calc the formula in mixed_layer
Created by: zuowang
I found there are projections and operators that can be used in mixed_layer. But how to write a mixed_layer that can do the following work as in tensorflow?
#KLD = D[N(mu(X), sigma(X))||N(0, I)] = 1/2 * sum(sigma_i + mu_i^2 - log(sigma_i) - 1)
KLD = 0.5 * tf.reduce_sum(sigma + tf.pow(mu, 2) - log_sigma - 1, reduction_indices = 1)