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

Kstar is not defined for some conditions #3

Open
quancs opened this issue May 23, 2023 · 2 comments
Open

Kstar is not defined for some conditions #3

quancs opened this issue May 23, 2023 · 2 comments

Comments

@quancs
Copy link

quancs commented May 23, 2023

Hello, I am currently translating the code to pytorch for using GPUs to speed up and for training neural networks (see Lightning-AI/torchmetrics#1792).
In the following code, I found that Kstar is not defined when BW == cutoffs(6) or BW == cutoffs(7) or BW == cutoffs(8) or BW <= cutoffs(5). Is it because that these conditions won't get satisfied anyway?

SRMRToolbox/SRMR.m

Lines 154 to 162 in f8be861

if (BW > cutoffs(5)) && (BW < cutoffs(6))
Kstar=5;
elseif (BW > cutoffs(6)) && (BW < cutoffs(7))
Kstar=6;
elseif (BW > cutoffs(7)) && (BW < cutoffs(8))
Kstar=7;
elseif (BW > cutoffs(8))
Kstar=8;
end

@tiagofalk
Copy link
Contributor

Hi,

Indeed, it should be:

if (BW >= cutoffs(5)) && (BW < cutoffs(6))
Kstar=5;
elseif (BW >= cutoffs(6)) && (BW < cutoffs(7))
Kstar=6;
elseif (BW >= cutoffs(7)) && (BW < cutoffs(8))
Kstar=7;
elseif (BW >= cutoffs(8))
Kstar=8;
end

kstar is only for conditions where BW>=cutoffs(5) so BW <= cutoffs(5) does not get satisfied.

@quancs
Copy link
Author

quancs commented May 24, 2023

kstar is only for conditions where BW>=cutoffs(5) so BW <= cutoffs(5) does not get satisfied.

So, the situation BW <= cutoffs(5) will never become true, right?

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