Closed randomir closed 5 years ago
:+1: I think this is expected behavior. For the new parameter that #56 will introduce, if it is set to tile
or random
, we may want to require num_reads
to be provided.
Or, we can just use use a default value for num_reads
(currently 10) in that case. That's backward compatible, and also seems nicer.
For example with the default, we could have:
ten_samples = sampler.sample(bqm)
# identical to
ten_samples = sampler.sample(bqm, initial_states_generator='random')
# and
ten_samples = sampler.sample(bqm, initial_states=empty, initial_states_generator='random')
vs
ten_samples = sampler.sample(bqm, num_reads=10)
On second thought, having implicit number of reads (the current behaviour) does seem a bit too magical -- especially if that number is some non-obvious magic constant.
I can see num_reads
defaulting to 1
, like we have on Tabu.sample, or requiring explicit number from the user...
After #53 and #56 are implemented, it would be convenient to have
num_reads
adapt to the size of theinitial_states
, IFFinitial_states
is non-null andnum_reads
is not provided.That way it's easier to adaptively sample/anneal off some initial sample set of varying size.