Open VolodyaCO opened 3 years ago
BTW, the covar matrices that seem to yield good gaussians are not positive semidefinite, as they have negative eigenvalues!
It seems like an overfitting problem here:
Can you share how is the DissimilarityMixtureAutoencoderCov
initialized or the complete notebook/code?
Maybe if you use less epochs and a smaller learning rate the problem can be solved.
I'll try to replicate it anyways, maybe it could be a problem with the covariance parameters in the tensorflow implementation.
A mate of mine and I have been writing this library in Pytorch. We found a couple of strange things with the covariance matrix, but we make sure that the covariance matrix is positive semidefinite. At the moment we have not yet tested the periodic mahalanobis case, but at least we have had some interesting discussion about how the shape of the covariance matrices are affected by training.
We will continue to develop the library, if you want to take a look at it you can give me your gitlab account and I will invite you!
Sure, my username in gitlab is juselara
.
I'll really appreciate to check the improvements over the covariance matrices and implement them to the tensorflow version.
Thanks
So, I understand that you are learning the inverse covariance matrix. You do so by defining a completely trainable matrix
X
, and then you obtain the inverse of the covariance matrix asS = X @ X.T
. So, in a way, you are using a factorisation of the covariance matrix inverse.Now, I am using the following code to plot the ellipses learnt by the DMAE method on the dataset presented in issue #1:
The plot generated when inputting the means and covariances using
plot_results(X, model2.layers[1].get_weights()[0], model2.layers[1].get_weights()[1])
yields a very good result!However, covar IS NOT the covariance matrix that defines the gaussian, as it should... The correct way of doing this is to uncomment the line that I point out in the code. When I do this, things go wrong!
Also, the visualisations using vis_utils are this:
which is nonsense. I wonder what I'm doing wrong, or if the visualisation utils are somehow mistaken.