dimod
dimod copied to clipboard
API for overriding Sampler default parameter values at construction time
It would nice to be able to set the default values for Sampler.sample
keyword arguments on sampler construction.
Something like
class ASampler(dimod.Sampler):
...
def sample(self, bqm, a=1, b=1, c=1):
...
sampler = ASampler(parameter_default=dict(a=5, b=3))
sampleset = sampler.sample(bqm, a=3) # 3 overrides the 5, but b=3 is used
Generalizes #501
See the use of embedding_parameters
in EmbeddingComposite
That's exactly what **runopts
in Hybrid are for -- but right now the interface is a mess and I'm working on generalization (under https://github.com/dwavesystems/dwave-hybrid/issues/141). It proved to be non-trivial.
The standard terminology for this functionality seems to be feed_dict
, which I personally dislike, but has permeated the tech world via TF. What about parameter_dict
instead of ..._default
? It's more descriptive of what is expected.