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

Minus sign in front of leaky relu #16

Open
sangho-vision opened this issue Dec 28, 2018 · 7 comments
Open

Minus sign in front of leaky relu #16

sangho-vision opened this issue Dec 28, 2018 · 7 comments

Comments

@sangho-vision
Copy link

sangho-vision commented Dec 28, 2018

Hello,
In your implementation of SpGAT,

there is this line:
edge_e = torch.exp(-self.leakyrelu(self.a.mm(edge_h).squeeze()))

However, I cannot understand why you added the minus sign in front of the leak relu operation.

Is that right?

@SongBaiHust
Copy link

I think it is wrong. No need to add this.

How do you think?

@Diego999
Copy link
Owner

Diego999 commented Feb 2, 2019

@sh0416

@sh0416
Copy link
Contributor

sh0416 commented Feb 2, 2019

Yes, it is wrong.

I want to avoid numerical instability.

Instead of minus sign, you need to subtract the max value of tensor like logsumexp.

@sgdantas
Copy link

Hey @sh0416 , sorry but what do you mean by "subtract the max value of tensor like logsumexp"
Thanks!

@iamlockelightning
Copy link

Hi @sh0416 , could you give a modification of the code?

@sh0416
Copy link
Contributor

sh0416 commented Oct 11, 2019

I read the code and concluded that just removing the minus sign will just work.

@gyxzhao
Copy link

gyxzhao commented Dec 18, 2023

Hi! @sh0416 I am new in deep-learning. I find that there will be inf during torch.exp(self.leakyrelu(self.a.mm(edge_h).squeeze())) (without the minus sign). Do you think the minus necessary for for numerical stability?Or we should switch to another function?

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

7 participants