Skip to content

Question regarding the mixture in MDN (pi) #11

Open
@Caselles

Description

I wonder how the mixture is done in MDN at test time (so when we want to dream).

http://blog.otoro.net/2015/11/24/mixture-density-networks-with-tensorflow/ : Here we have an example of a MDN with k Gaussians of parameters (mu_k, sigma_k) that are 1-dimensional. E.g mu_k and sigma_k are scalars. Since we can only mix these K Gaussians by taking one of the K possible pair of parameters (mu_k, sigma_k), the shape of Pi is Pi = (Pi_1, ..., Pi_k) with each Pi_j being the (scalar) probability of selecting the j-th Gaussian.

In the case of the MDN in World Models, the k Gaussians of parameters (mu_k, sigma_k) are n-dimensional (with the same dimension as z, the encoded feature coming from the VAE). Hence given one sample there a choice for mixture, you can:

  1. have the same shape of Pi as before, with Pi = (Pi_1, ..., Pi_k) with each Pi_j being the (scalar) probability of selecting the j-th Gaussian.
  2. Pi is a matrix of size (k, n): Pi = (Pi_1, ..., Pi_n) where n is the dimension of z (encoding from the VAE). For each j, Pi_j = (Pi_j_1, ..., Pi_j_k) where Pi_j_l is the probability of selecting the l-th component of mu_j and sigma_j. So, for each j in 1..n, one can sample according the distribution P_j (this is where you can modify this distribution with temperature to have a more or less stochastic world model if I understand right) to select the j-th component of any of the k gaussians. The result is a new mu and new sigma, both n-dimensional mix of the components of mu_k and sigma_k. Finally, you can sample according to this mixture to obtain the next z.

For 1), there are k Gaussians to choose from, while for 2) there are actually n*k Gaussians to choose from.

Which one is right and why ?

In available implementations, I see that people seem to use 2) (since the shape of Pi is (NB_GAUSSIANS, SIZE_FEATURE_VAE)).

[I also asked my question in the comments on Reddit : https://www.reddit.com/r/MachineLearning/comments/8poc3z/r_blog_post_on_world_models_for_sonic/ . If I get an answer there, I will close the issue and reference the answer there.]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions