d4l3k/go-bayesopt

Provide a random seed for sampling

domenicrosati opened this issue · 3 comments

It would be great if we could provide a random seed for sampling so we can write determanistic tests.

What do you think @d4l3k ?

d4l3k commented

Yeah, that could certainly be helpful in certain situations. I'm hesitant to add seeds to every type since I'm worried it'll clutter up the API but it might be reasonable to add one generation per optimiser and pass it in via an optional flag.

Another thing to consider is calling rand.Seed(0) before your tests where you need determinism. Would that be enough for your use case or do you need to be able to specify the seed for each optimiser for parallel execution?

that is perfect thanks! I am still new to go.

d4l3k commented