Skip to content

Add option for continuous sampling #24

Description

@randomir

Keeping N samples in memory is expensive if we only want the k best ones!

Open question is the interface -- num_reads is synonymous with num_samples returned in sample set for all samplers in Ocean. Also, initial_states (even for random states) are expanded to num_reads input samples -- something we would also want to avoid in this case.

To retain compatible behavior with existing samplers, perhaps we could introduce a parameter like num_resample. Also, resample_reduce_method (min/max). And to support the k best samples use case, we'll need a parameter like num_samples.

So, something like:

ss = greedy.sample(bqm, num_reads=1, num_resample=1000, num_samples=3, resample_reduce_method='k-best')

Another take on this would be async sampler interface. In which case a caller would yield as many samples are needed, all with minimal memory overhead!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions