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 Deep Sets Implementation #4

Closed
arnavs opened this issue Apr 20, 2020 · 2 comments
Closed

Question about Deep Sets Implementation #4

arnavs opened this issue Apr 20, 2020 · 2 comments

Comments

@arnavs
Copy link

arnavs commented Apr 20, 2020

Hi @juho-lee,

First of all, thanks for making this code publicly available. It's very useful.

One question, though. I am looking at your implementation of the Zaheer et al network ("Deep Sets.") In his paper, we have something like rho(sum (phi(x))), where we are adding over each element of the set (I believe you call this a set pooling method in your paper )

In your DeepSet class, we have a succession of Linear -> ReLU -> Linear -> ReLU layers, that operate on the entire data set, and then are pooled at the end.

Could you explain a little about why these are equivalent?

@juho-lee
Copy link
Owner

Hi,
Linear layers act on individual elements, so it is equivalent to applying the same linear operation (phi(x)) to each element in a set. Also, Linear layers in Pytorch supports batched operation, thus the same applies for batched inputs (batch_size * num_elements * dim tensors).

@arnavs
Copy link
Author

arnavs commented Apr 22, 2020

Roger that, thank you @juho-lee for the response.

@arnavs arnavs closed this as completed Apr 22, 2020
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