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

Use Gaussian noise in place of Poisson noise beyond threshold to improve performance #45

Closed
wants to merge 1 commit into from

Conversation

Tiomat85
Copy link
Contributor

@Tiomat85 Tiomat85 commented Aug 7, 2024

Adding check and handling of Poisson noise generation when lambda is high to fallback to a Gaussian distribution for performance reasons.

Adding check and handling of Poisson noise generation when lambda is high to fallback to a Gaussian distribution for performance reasons.
@Tiomat85
Copy link
Contributor Author

Tiomat85 commented Aug 7, 2024

This is for fixing Issue 44 on usim
#44

@cmeyer cmeyer requested a review from Brow71189 August 7, 2024 21:08
Copy link
Contributor

@cmeyer cmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, I feel like a broken record for repeatedly bringing this up, but this needs a decent commit message. "Extending Poisson Noise" in no way describes this commit. I'd really like to get PR's that ready to go rather than require editing by me to change something as simple as a commit message. If I were writing it I would say something like "Use Gaussian noise in place of Poisson noise beyond threshold to improve performance."

Also, I'd like Andreas to approve this change since it may affect other projects.

@cmeyer
Copy link
Contributor

cmeyer commented Aug 7, 2024

I tested this code on my machine, it results in an improvement from 220ms (Poisson) to 75ms (Gaussian). This is a welcome improvement, but might not be sufficient for performance testing #44. I added notes there.

@Tiomat85 Tiomat85 changed the title Extending Poisson Noise Use Gaussian noise in place of Poisson noise beyond threshold to improve performance Aug 8, 2024
@Tiomat85
Copy link
Contributor Author

Tiomat85 commented Aug 8, 2024

The original Issue was that the Poisson noise generation was taking an increasing amount of time as the exposure increased, as it became too long. The solution of changing to a Gaussian distribution for 'high' values of lambda (exposure) resolves this original problem. So what you now get is increasing time calculated until you hit this threshold and then it flatlines which is exactly what the original issue wanted.

I'm confused as to the reasoning of adding in extra complexity, with no particular defined requirement or use cases. If there is a defined test or objective that is not being met then at that point you can look at implementing something a bit more complicated as you have a pass criteria of the fix being done. Without that any performance work can easily hit this scenario, where the defined problem is resolved and performance 'improved' but with no end line there is no ability to say it is 'done'.

@cmeyer
Copy link
Contributor

cmeyer commented Aug 8, 2024

As a reminder, the title of the PR is not the permanent title of the commit message. You would need to git commit --amend to edit the commit message, then force push to this PR to clean it up. It's much easier to write good commit messages in the first place. Btw, I'm planning to merge this as soon as @Brow71189 gives his ok.

@cmeyer
Copy link
Contributor

cmeyer commented Aug 8, 2024

Merged aec8bc5

@cmeyer cmeyer closed this Aug 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants