Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the shape of the input array #50

Closed
Sunflowerbeaut opened this issue Mar 3, 2023 · 3 comments
Closed

Question about the shape of the input array #50

Sunflowerbeaut opened this issue Mar 3, 2023 · 3 comments

Comments

@Sunflowerbeaut
Copy link

I have created an autoencoder as a feature extractor. To make the output of the encoder as independent as possible from the input. I chose dcor as an additional loss to train the autoencoder. However, I have some problems when calculating the dcor loss.
The input shape of the batch data is [32, 1, 28, 14] and the embedding shape is [32, 8, 14, 7]. But it seems that the calculation cannot be performed directly. The Error part is as follows:
image

I wonder if there have some way to calculate the dcor loss of the input and the embedding. Hope to get your answer :)

@vnmabus
Copy link
Owner

vnmabus commented Mar 3, 2023

What distance_correlation expects is two matrices N x P, and N x Q with N the number of observations and P and Q the dimensions of the two random vectors.

Depending on what your dimensions mean, you want to reshape the tensor to put them as part of one of these two categories, or to compute distance_correlation several times (you could use rowwise in this case).

@vnmabus
Copy link
Owner

vnmabus commented Mar 12, 2023

Were you able to fix your problem?

@Sunflowerbeaut
Copy link
Author

Thank you for your response. I have conducted experiments on MNIST dataset, but the distance correlation hardly changed. Anyway, thank you again! Hope you have a wonderful day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants