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

Maybe some typos in total_variation_kernel.cu #34

Closed
chuchong opened this issue Aug 18, 2022 · 2 comments
Closed

Maybe some typos in total_variation_kernel.cu #34

chuchong opened this issue Aug 18, 2022 · 2 comments

Comments

@chuchong
Copy link

in lib/cuda/total_variation_kernel.cu

    grad_to_add += (k==0      ? 0 : wz * clamp(param[index]-param[index-1], -1.f, 1.f));
    grad_to_add += (k==sz_k-1 ? 0 : wz * clamp(param[index]-param[index+1], -1.f, 1.f));
    grad_to_add += (j==0      ? 0 : wy * clamp(param[index]-param[index-sz_k], -1.f, 1.f));
    grad_to_add += (j==sz_j-1 ? 0 : wy * clamp(param[index]-param[index+sz_k], -1.f, 1.f));
    grad_to_add += (i==0      ? 0 : wz * clamp(param[index]-param[index-sz_k*sz_j], -1.f, 1.f));
    grad_to_add += (i==sz_i-1 ? 0 : wz * clamp(param[index]-param[index+sz_k*sz_j], -1.f, 1.f));
    grad[index] += grad_to_add;

It seems wx is not used there, maybe it's typos?

@sunset1995
Copy link
Owner

Yes, you are right. Thanks for finding it!

@gkouros
Copy link

gkouros commented Jul 12, 2023

@sunset1995 This is still not fixed. There is an active pull request #63 that fixes this. Can you please merge it?

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

3 participants