You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than calling rand(...), it would be good to call rand(rng, ...) with an optionally user-specified rng::AbstractRNG keyword argument in algorithms that require pseudo-random initialization, e.g. lobpcg (
Rationale: if deterministic results are desired (as is often the case), it is better for the user to be able to specify an RNG than setting the globalRandom.seed!.
Moreover, arguably the default rng should be a new deterministic RNG object created with a fixed seed every time the iterative solver is initialized, so that the algorithm defaults to being deterministic.
(Note: "deterministic" ≠ "reproducible" … e.g. changing the Julia version could change the results. But it is useful to be able to run the same code with the same software on the same hardware multiple times and get exactly the same results as much as possible.)
The text was updated successfully, but these errors were encountered:
Different iterative algorithms initialize different pseudorandom internal state. It seems like it's asking a lot of the caller to know what that internal state means for different solvers. Also, it's nice to have a uniform API that works with all of the algorithms that employ pseudorandom state.
Rather than calling
rand(...)
, it would be good to callrand(rng, ...)
with an optionally user-specifiedrng::AbstractRNG
keyword argument in algorithms that require pseudo-random initialization, e.g. lobpcg (IterativeSolvers.jl/src/lobpcg.jl
Line 872 in ae01dfe
IterativeSolvers.jl/src/bicgstabl.jl
Line 38 in ae01dfe
IterativeSolvers.jl/src/bicgstabl.jl
Line 38 in ae01dfe
Rationale: if deterministic results are desired (as is often the case), it is better for the user to be able to specify an RNG than setting the global
Random.seed!
.Moreover, arguably the default rng should be a new deterministic RNG object created with a fixed seed every time the iterative solver is initialized, so that the algorithm defaults to being deterministic.
(Note: "deterministic" ≠ "reproducible" … e.g. changing the Julia version could change the results. But it is useful to be able to run the same code with the same software on the same hardware multiple times and get exactly the same results as much as possible.)
The text was updated successfully, but these errors were encountered: