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 shuffle RandomVariable #1367

Open
rlouf opened this issue Dec 13, 2022 · 3 comments
Open

Add shuffle RandomVariable #1367

rlouf opened this issue Dec 13, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed Op implementation Involves the implementation of an Op random variables Involves random variables and/or sampling

Comments

@rlouf
Copy link
Member

rlouf commented Dec 13, 2022

https://numpy.org/doc/stable/reference/random/generated/numpy.random.shuffle.html

@rlouf rlouf added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed random variables Involves random variables and/or sampling Op implementation Involves the implementation of an Op labels Dec 13, 2022
@PaulScemama
Copy link

What do you have in mind for this? I apologize but I'm not sure what this would entail at a lower-level. For example, call numpy's shuffle? Create our own shuffle with the Fisher-Yates algorithm? Thanks!

@brandonwillard
Copy link
Member

brandonwillard commented Mar 27, 2023

What do you have in mind for this? I apologize but I'm not sure what this would entail at a lower-level. For example, call numpy's shuffle? Create our own shuffle with the Fisher-Yates algorithm? Thanks!

When it comes to implementing a new Op, the approach is generally as follows:

  1. Determine how much, if any, of the Op can be implemented using existing Ops in Aesara.
  2. For the part(s) that can't be implemented using existing Ops, we need to create new Ops, which consists of the following steps:
    • Determine the input and output Types (i.e. the Op.make_node implementation).
    • Determine how the symbolic inputs and their shapes relate to the symbolic shapes of the outputs (i.e. the Op.infer_shape implementation).
    • Determine the symbolic gradients for each input/output combination (i.e. the Op.L_op/Op.grad implementation).
    • Determine the implementations in Python (i.e. Op.perform), C (i.e. Op.c_code), Numba, and/or JAX. Only the Python implementation is absolutely necessary, but the others are needed for performance and the general usefulness of the Op.

@PaulScemama
Copy link

Thanks for this overview! I've been a bit busy the last couple days so haven't had a chance to dive in at all, but looking forward to taking a better look this weekend (if not this week).

@zoj613 zoj613 self-assigned this Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed Op implementation Involves the implementation of an Op random variables Involves random variables and/or sampling
Projects
None yet
Development

No branches or pull requests

4 participants