aakhundov / tf-example-models

TensorFlow-based implementation of (Gaussian) Mixture Model and some other examples.
Apache License 2.0
43 stars 13 forks source link

Questions about the prior issues #3

Open cyk1337 opened 4 years ago

cyk1337 commented 4 years ago

Hi there,

I am confused about the part of applying prior to the computed variances. Would you by any chance explain it? Thanks ;) Link

# applying prior to the computed variances
variances_ *= tf.expand_dims(gamma_sum, 1)
variances_ += (2.0 * beta)
variances_ /= tf.expand_dims(gamma_sum + (2.0 * (alpha + 1.0)), 1)

Also, does the log_shit means the normalization here?

log_weighted = log_components + tf.expand_dims(tf.log(weights), 1)
log_shift = tf.expand_dims(tf.reduce_max(log_weighted, 0), 0)
exp_log_shifted = tf.exp(log_weighted - log_shift)

In addition, at line 82:

log_likelihood = tf.reduce_sum(tf.log(exp_log_shifted_sum)) + tf.reduce_sum(log_shift)

Why added above mentioned maximum value of each component log_shift?