Conversation
Member
|
Hi @edenbaus . Thanks for the PR. I'm a bit curious about this, I would have expected these to be more-or-less the same. Is there a performance difference? |
Author
|
Hello,
Thanks for looking at my pull request.
I looked into the performance differences. I'm a bit surprised, but the
base python power function tends to be faster than the numpy power function
for power = 2. However, when raising values to a power > 2, the performance
between the base python power function and the numpy power function is
effectively identical.
The other difference is precision, numpy's power function offers much
greater floating point precision over the base python power function.
Given the negligible performance difference between both approaches, it's
your call if you think the increased precision is important enough to
include this pull request.
Best Regards,
Scott Edenbaum
…On Mon, Apr 9, 2018 at 12:44 AM, Matthew Rocklin ***@***.***> wrote:
Hi @edenbaus <https://github.com/edenbaus> . Thanks for the PR. I'm a bit
curious about this, I would have expected these to be more-or-less the
same. Is there a performance difference?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#70 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AXy0QSr4x_79OUJGJfE923RNFhuApmLsks5tmucmgaJpZM4TL7EG>
.
|
Member
|
My guess would be that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change builtin python power function to Numpy power ufunc