We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It's not a big deal for now but ultimately we'll want to be able to set seeds for the rewiring algorithms. I see a few possibilities for this:
random
random.seed($SEED)
Generator
random.Random
np.random.Generator
I think #3 could look like the following:
class BaseRewirer: <...> def __init__(seed: Optional[int] = None): self.rand = random.Random(seed) <...> def rewire(self, G, **kwargs): # selecting a random edge rand_edge = rand.choice(list(G.edges)) <...>
The challenge with using np.random.Generator is that numpy randomness wants to return arrays, which we don't always want (e.g., when sampling edges).
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's not a big deal for now but ultimately we'll want to be able to set seeds for the rewiring algorithms. I see a few possibilities for this:
random
, and set the seed usingrandom.seed($SEED)
. I don't like this because it mutates global state.Generator
object. This is probably preferable but a bit heavy (and tricky for users).random.Random
as an attribute, and call that to generate random numbers.np.random.Generator
.I think #3 could look like the following:
The challenge with using
np.random.Generator
is that numpy randomness wants to return arrays, which we don't always want (e.g., when sampling edges).The text was updated successfully, but these errors were encountered: