-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Dirichlet distribution with dynamic size n
#14
Comments
I agree. There is a similar issue in rust-random/rand#1478 which would also introduce on static and one dynamic sized distribution. We should definitely decide how to handle multidimensional distributions and it should provide the user with both options. |
Do you have any concrete use cases for the static (i.e. const-generic) implementations of multi-dimensional distributions? I understand the general desire to reduce the number of allocations, but duplicating all the relevant distributions adds a lot of bloat, so it should need to justify itself imo. |
I am pretty sure the only advantage is reducing the number of allocations, but this also allows it to be used in non std mode. |
Thanks for the issue and PR @MortenLohne. As you noted, I did point out the limitation of rust-random/rand#1292 at the time, but I did not appreciate the impact.
This is a good question. I tried searching for usages of
Going by the above (very limited) data, there doesn't appear to be much use for compile-time-fixed-length input but there may be justification for a
I doubt there's much need for
I did wonder if we could parameterise over the storage type (e.g. |
I wonder if we should simply Edit: I moved this topic to #16. |
Background
#8 changed the Dirichlet distribution to be const-generic over size, meaning it can no longer be used where the vector length is only known at runtime. This broke my use case, see motivation below.
What is your motivation?
Reinforcement learning for "chess-like" games. In AlphaZero and its many derivatives, Dirichlet noise is applied to each position's move probabilities vector, where the number of moves depends on the position and cannot be known at compile-time. Stack Exchange post with some context.
Feature request
Either revert
Dirichlet
back to having a dynamic size, or add it back asDirichletDynamic
or similar. My choice would be to simply revert it, but it's honestly not clear to me why the change was done in the first place, since the const-generic version still requires thealloc
feature. Was generating Dirichlet distributions a performance bottleneck for anyone?The text was updated successfully, but these errors were encountered: