-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Right now, mmd is scattered trough the whole code:
- in utils: mmd(k,X,Y)
- in abstract_pdfs: mmd(p::AbstractCPDF, q::AbstractPDF, z::AbstractArray, k)
- in vae: mmd(m::AbstractVAE, x::AbstractArray, k)
I do not see the need for all that. MMD is a distance between two samples, so the only meaningful definition is 1.
-
is a specializaton to arbitrary pdfs. It would be fine for PDF,PDF where you would define N samples from each. However, as it is defined now, I am completely puzzled what it theoretical operation it should do. It is only a specific (programming convenience) form that is used in WAE, with not much meaning elsewhere. I propose to drop it.
-
MMD is not a measure on VAE, the current function only calls some mmd from abstract_pdfs. Again, it has no theoretical meaning. I propose to drop it.
Instead, I would define a wasserstein loss as an alternative to elbo:
Wasser(m::AbstractVAE, x::AbstractArray, k, beta)=
mse(x, mean(model.decoder, mean(model.encoder,x))) + beta*mmd(k,rand(model.encoder,x), rand(model.prior,size(x,2)))