-
Notifications
You must be signed in to change notification settings - Fork 40
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
RFC: move log/exp variants to a separate package #46
Comments
We have previously discussed this and I think these could and should just be moved to |
These are not really related to statistics though, they could live in a separate stdlib module. |
I think these are mainly used in the evaluation of functions used in statistics so until there is a demand outside statistics I think it is to avoid scattering functionality into more packages. |
I agree with Andreas, I think StatsBase is a good home for them, or at least good enough. |
@tpapp I think this sounds good. Also if someone does move these over please check the https://github.com/JuliaStats/StatsFuns.jl/tree/promotions branch which has several updates to logpdfs/pdfs that I have been wondering if they would ever make it into master |
As a user I would appreciate a stable home for these functions so that I can use them without worrying their location might change in the future. I like @tpapp suggestion because I think these functions pop up in many different areas. But on the other hand why not just leave them here in |
I think that a separate repository would make a lot of sense, as those who just want eg I created https://github.com/tpapp/LogExpFunctions.jl and moved the log/exp functions there, with the following improvements:
I am very happy to transfer this repository to JuliaStats, then after it is registered, make a PR removing this functionality from this package (after a deprecation period, during which one would reexport). Comments are welcome. |
Fine with me. You'll probably want to port over #74. |
Happy to do that. How should I proceed about transferring that package to JuilaStats? Should I register before, or after that? |
I started registration: JuliaRegistries/General#3594 |
@nalimilan, if you have permissions can you please help with with making the transfer of the above package to JuliaStats? |
If this is its own package, why does it need to live in JuliaStats? |
Sorry, I don't fully understand the question here. My understanding was that JuliaStats organizes key packages for statistics in Julia. While I am happy to maintain LogExpFunctions, I would like others to have write access to the repo, and also I don't want to just copy the work of other people to create a new package without at least putting it in the same Github organization. Hope this makes sense. |
Sorry, I missed the part where the other functions were moved to that package. |
I understand the desire to decouple the functionality in StatsFuns from that provided by the binary dependency on rmath, but at the same time I think this is the most natural home for these functions. It seems unnecessary to have a separate repository just for them. |
Any possibility those pure Julia functions could be moved to |
@ararslan: I think that separate packages make a lot of sense, especially they allow decoupling native Julia code and wrappers for an external library, where the two sets of functions not closely related in the first place. Very importantly, they allow a more granular versioning, and also the cost is near-zero with Pkg3. @xukai92: While these functions are used in statistics, they also have other applications (machine learning, modeling in natural and social sciences). |
Yeah I understand those functions are used outside statistics but so do functions like |
I am waiting for feedback from the maintainers here about what they would prefer: I can either
|
Maybe file an issue in Julia so that we can discuss what could be moved to Statistics or Base.Math. For example, |
If the main reason for moving these functions away from this package into their own package is that |
This has been proposed multiple times, but AFAIK never got off the ground. This would of course be ideal, but since this is a major undertaking that requires some expertise, I would not count on this happening in the medium run. If someone is willing to undertake this, then we can discuss this as a realistic option, but otherwise I don't see this as a practical solution to the binary dependency problem. Conversely, if/when this happens, all numerical functions could be consolidated back into a single package. Log/exp functions are a bit special since frequently one just requires an adjustment or a branch for large/small values, and then can use basic math and simple building blocks to code it natively (the only exception is |
To avoid code duplication, can |
Just to add to this: I am happy to add any of the StatsFuns maintainers to that repo (just ask in an issue). The intention was, and still is, to avoid binary dependencies for these functions. |
I can make the PR for this, if folks agree to merge. |
I think it would be helpful to separate the log/exp functions from StatsFuns, also to address FluxML/NNlib.jl#252 and to be able to share |
@tpapp knows better, but maybe starting again from the state of StatsFuns is simpler. Then I would suggest having StatsFuns reexport these functions to avoid any breakage. But in parallel I think someone should file an issue against Julia to discuss the possibility of moving all or some of these to Base or Statistics. |
I would be happy to update LogExpFunctions with the changes in StatsFuns. However, the main purpose of that package was to demo the possibility of moving these out of StatsFuns, so it makes most sense if functionality is moved there (and possibly reexported by StatsFuns if necessary). This requires a decision from StatsFun maintainers. If they are OK with this plan, I will of course move the LogExpFunctions repo to JuliaStats and do the updates. |
It would be nice to make a decision here, since this is a breaking change and the later the decision is made the more breakage it can cause. I think many packages depend on these functions. |
As far as I can see, this would not be breaking if StatsFuns would reexport these functions, as suggested above. |
Probably it would still be nice to make a decision to avoid that NNlib, StatsFuns, and LogExpFunctions continue to diverge even more. |
I'd be fine with moving these functions to LogExpFunctions (and reexport them). But as I said above:
|
I don't think the implementation of, in particular, |
Changing implementations in Base isn't a problem AFAIK. We recently radically changed the implementation of |
But for now let's just put them in their own package, which can be a stable home for them (even if later on they are also ported to the stdlib). |
Can we consider registering LogExpFunctions? The name LogExpFunctions is pretty explicit, so I don't think it will lead to issues later on if a decision is finally made regarding where to port / re-export these functions. |
Wouldn't it make sense to update LogExpFunctions (or create a new package with the current version of these functions in StatsFuns) first, as discussed above? |
I am happy to register, but currently have no bandwidth for the updates. PRs welcome. |
If this update doesn't imply an API change, I vote to register LogExpFunctions now, and update later. Even if there is an API change, we can just respect SemVer. Let's register? |
At least you would want to configure CI, CompatHelper, TagBot etc. properly, no? In general, I don't see why it would be useful to rush this - who would want to use a package whose implementations are outdated and strictly inferior to the versions in StatsFuns? 😄 |
I am happy to fix CI etc if someone is willing to port #74. Generally, I see no problem with this functionality being in its own lightweight package. I don't agree that it is used only in statistics, these functions are used in other areas. OTOH, I also want to be a good citizen here and not just duplicate functionality from other packages without some consensus about the big picture. Again, LogExpFunctions was (is?) just a demonstration of what that lightweight package could look like. |
I'll put together a PR with #97 later today. |
Thanks to @devmotion, LogExpFunctions.jl is now up to date. I initiated registration, and the transfer of the repo to JuliaStats. |
I am thinking of the functions in src/basicfuns.jl.
In contrast to distribution functions, these are all implemented in pure Julia, require no external dependencies, and thus have no license issues. In fact, while they are used in statistics, they are not even "statistical" functions since other fields make ample use of them. Cf #20; these functions are useful for the end user directly, without requiring an interface like Distributions.jl.
I propose
LogExpFunctions.jl
as a package name. If the discussion suggests this makes sense, I would be happy to do a PR.The text was updated successfully, but these errors were encountered: