Skip to content

Commit

Permalink
fix loc and scale_diag kwargs to ParamMixture in unsupervised tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinvtran committed Apr 27, 2017
1 parent 39b6cea commit 52fef60
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 41 deletions.
2 changes: 1 addition & 1 deletion docs/tex/tutorials/unsupervised.tex
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ \subsubsection{Model}
pi = Dirichlet(tf.ones(K))
mu = Normal(tf.zeros(D), tf.ones(D), sample_shape=K)
sigmasq = InverseGamma(tf.ones(D), tf.ones(D), sample_shape=K)
x = ParamMixture(pi, {'mu': mu, 'diag_stdev': tf.sqrt(sigmasq)}, MultivariateNormalDiag,
x = ParamMixture(pi, {'loc': mu, 'scale_diag': tf.sqrt(sigmasq)}, MultivariateNormalDiag,
sample_shape=N)
z = x.cat
\end{lstlisting}
Expand Down
2 changes: 1 addition & 1 deletion edward/inferences/conjugacy/conjugate_log_probs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def multinomial_log_prob(self, val):
@_val_wrapper
def mvn_diag_log_prob(self, val):
loc = self.parameters['loc']
scale_diag = self.parameters['scale'].diag
scale_diag = self.parameters['scale_diag']
prec = tf.reciprocal(tf.square(scale_diag))
result = prec * (-0.5 * tf.square(val) - 0.5 * tf.square(loc) +
val * loc)
Expand Down
Loading

0 comments on commit 52fef60

Please sign in to comment.