Open bashhwu opened 6 years ago
Tthe following example considers mu and sigma as a scalar. what if they are arrays?
tfd = tf.contrib.distributions mix = 0.3 bimix_gauss = tfd.Mixture( cat=tfd.Categorical(probs=[mix, 1.-mix]), components=[ tfd.Normal(loc=-1., scale=0.1), tfd.Normal(loc=+1., scale=0.5), ])
tfd.Normal(loc=-1., scale=0.1) accepts loc and scale to be arrays but when used inside the tfd.Mixture, an error message is generated ( Shapes () and (784, 400) must have the same rank)
Tthe following example considers mu and sigma as a scalar. what if they are arrays?
Create a mixture of two Gaussians:
tfd = tf.contrib.distributions mix = 0.3 bimix_gauss = tfd.Mixture( cat=tfd.Categorical(probs=[mix, 1.-mix]), components=[ tfd.Normal(loc=-1., scale=0.1), tfd.Normal(loc=+1., scale=0.5), ])
tfd.Normal(loc=-1., scale=0.1) accepts loc and scale to be arrays but when used inside the tfd.Mixture, an error message is generated ( Shapes () and (784, 400) must have the same rank)