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

add logsubexp(x,y) #95

Merged
merged 16 commits into from
May 21, 2020
Merged

add logsubexp(x,y) #95

merged 16 commits into from
May 21, 2020

Conversation

cossio
Copy link
Contributor

@cossio cossio commented May 19, 2020

This is useful in some contexts. Other libraries have this, for example, https://www.tensorflow.org/probability/api_docs/python/tfp/math/log_sub_exp

If this gets merged please tag a release (I bumped the version here).

@ararslan ararslan requested a review from simonbyrne May 19, 2020 18:32
src/basicfuns.jl Outdated Show resolved Hide resolved
test/basicfuns.jl Outdated Show resolved Hide resolved
src/basicfuns.jl Outdated Show resolved Hide resolved
@cossio
Copy link
Contributor Author

cossio commented May 20, 2020

Merge?

Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

I have the feeling we discussed similar xlogx issues recently but I can't find where...

.gitignore Outdated Show resolved Hide resolved
src/basicfuns.jl Outdated Show resolved Hide resolved
src/basicfuns.jl Show resolved Hide resolved
src/basicfuns.jl Show resolved Hide resolved
src/basicfuns.jl Show resolved Hide resolved
src/basicfuns.jl Outdated Show resolved Hide resolved
src/basicfuns.jl Outdated Show resolved Hide resolved
src/basicfuns.jl Show resolved Hide resolved
Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

Thanks!

@cossio
Copy link
Contributor Author

cossio commented May 20, 2020

@nalimilan Thank you for taking a look!
Nothing left to merge? Also please tag a release with this.

@nalimilan
Copy link
Member

After considering this again, I found out that x log x has no limit in 0 for complex numbers. So the docstring isn't correct for them. How about just mentioning that we return zero for zero (for both xlogx and xlogy, like Numpy does? We could still mention that it's consistent with the limit for reals. See also the previous discussion we had about this (I just found it again!): #87 (comment)

@cossio
Copy link
Contributor Author

cossio commented May 21, 2020

Good point @nalimilan. Done.

@simonbyrne simonbyrne merged commit 069cbb0 into JuliaStats:master May 21, 2020
@cossio cossio deleted the logsubexp branch May 21, 2020 15:20
@cossio
Copy link
Contributor Author

cossio commented May 21, 2020

Please tag a release with this. Thanks!

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.

None yet

3 participants