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 wrappers to random number generators #39

Merged
merged 3 commits into from
Jul 18, 2024
Merged

Add wrappers to random number generators #39

merged 3 commits into from
Jul 18, 2024

Conversation

jeremykubica
Copy link
Contributor

Add random number generator functions from both jax and numpy. These subclass the FunctionNode so they can be included directly as nodes in the execution graph. Both node types handle the seeding and maintaining of their respective random number generators.

@jeremykubica jeremykubica requested a review from hombit July 18, 2024 14:42
Copy link
Contributor

@hombit hombit left a comment

Choose a reason for hiding this comment

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

This is beautiful!

What is going to happen when we want to generate two different independent values within a single node? How users would implement it? Is it supposed to be a use-case?

src/tdastro/util_nodes/np_random.py Outdated Show resolved Hide resolved
@jeremykubica
Copy link
Contributor Author

As we discussed in person, this implementation doesn't support generating two different independent values within a single node. But I will think about the best way to extend it in order to do that.

@jeremykubica jeremykubica merged commit e55b4d6 into main Jul 18, 2024
4 checks passed
@jeremykubica jeremykubica deleted the jax_random branch July 18, 2024 15:00
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.

2 participants