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

Derivative bugs #4

Closed
weepiess opened this issue May 21, 2021 · 1 comment
Closed

Derivative bugs #4

weepiess opened this issue May 21, 2021 · 1 comment

Comments

@weepiess
Copy link

Hi,

for l in range(L):
      I = torch.t(torch.reshape(X[l], (3, -1)))
      II = torch.pow(I, 2)
      if self.intensity_scale:
        Iy = torch.unsqueeze(torch.sqrt(II[:, 0] + II[:, 1] + II[:, 2]), dim=1)
      else:
        Iy = 1

I found a bug here:

torch.sqrt(II[:, 0] + II[:, 1] + II[:, 2]), dim=1)

sqrt is not derivable at point 0
Therefore, it is better to change to this:

torch.sqrt(II[:, 0] + II[:, 1] + II[:, 2]+ EPS), dim=1)
@mahmoudnafifi
Copy link
Owner

Thanks for catching this. Fixed.

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