Commit 3152d495 authored by Yuxin Wu's avatar Yuxin Wu

reduction_indices was deprecated in TF

parent b0fc944d
......@@ -172,7 +172,7 @@ class CategoricalDistribution(Distribution):
def _loglikelihood(self, x, theta):
eps = 1e-8
return tf.reduce_sum(tf.log(theta + eps) * x, reduction_indices=1)
return tf.reduce_sum(tf.log(theta + eps) * x, 1)
def _encoder_activation(self, dist_param):
return tf.nn.softmax(dist_param)
......@@ -214,8 +214,7 @@ class GaussianDistribution(Distribution):
exponent = (x - mean) / (stddev + eps)
return tf.reduce_sum(
- 0.5 * np.log(2 * np.pi) - tf.log(stddev + eps) - 0.5 * tf.square(exponent),
reduction_indices=1
- 0.5 * np.log(2 * np.pi) - tf.log(stddev + eps) - 0.5 * tf.square(exponent), 1
)
def _encoder_activation(self, dist_param):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment