-
Notifications
You must be signed in to change notification settings - Fork 24
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
Troubled by 1 instance of np.flatnonzero #21
Comments
Hello William. Are you asking about why that selection |
Dear Peter Melchior,
Thank you to replying to my concern. Specifically, I am porting your code to Java for use in the MIPAV medical imaging software at NIH and I noticed that when a zero index was present the line U_k = np.flatnonzero(indices) produced a U_k whose length was 1 less than the chi2 length, T_inv_k length, and log_p[k] length created in the same _ESum module. Also, I could not understand why the zero index would be excluded.
Sincerely,
William Gandler
…________________________________
From: Peter Melchior ***@***.***>
Sent: Monday, June 6, 2022 11:28 AM
To: pmelchior/pygmmis ***@***.***>
Cc: Gandler, William (NIH/CIT) [E] ***@***.***>; Author ***@***.***>
Subject: [EXTERNAL] Re: [pmelchior/pygmmis] Troubled by 1 instance of np.flatnonzero (Issue #21)
Hello William. Are you asking about why that selection U_k = np.flatnonzero(indices) is done, or do you have trouble that is caused by this line?
—
Reply to this email directly, view it on GitHub<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpmelchior%2Fpygmmis%2Fissues%2F21%23issuecomment-1147579488&data=05%7C01%7Cilb%40mail.nih.gov%7Cb7935f4637b640617c7c08da47d133f8%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C637901261090493654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4Eyhd7h%2BtFbsqHzrBQtqrSQtrogJVVmZMuLQ9zIOG5s%3D&reserved=0>, or unsubscribe<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXMJ77B4GQR5L752HQSAFKDVNYKIXANCNFSM5X245B6Q&data=05%7C01%7Cilb%40mail.nih.gov%7Cb7935f4637b640617c7c08da47d133f8%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C637901261090493654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oojGOJsooTGQgL8lmAKMLTkxfs9557DqdGgmgQLJTAo%3D&reserved=0>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and are confident the content is safe.
|
I'm not sure how this can happen. The relevant part of the code is this: Lines 993 to 1001 in 87ad02d
The array The following code does exactly the same in a nutshell: test = np.random.rand(10)
indices = test < 0.5
print(indices, np.flatnonzero(indices)) |
Hi,
I am troubled by 1 instance of np.flatnonzero. In _ Esum the lines:
if U_k is None:
U_k = np.flatnonzero(indices)
Removing 0 index makes U_k length 1 less than chi2 length, T_inv_k length, and log_p[k] length. I don't see why the zero index is removed.
The text was updated successfully, but these errors were encountered: