Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify/update SplatComposer behavior #281

Open
randomir opened this issue Dec 7, 2022 · 0 comments
Open

Clarify/update SplatComposer behavior #281

randomir opened this issue Dec 7, 2022 · 0 comments

Comments

@randomir
Copy link
Member

randomir commented Dec 7, 2022

Note:

  • hybrid.SplatComposer does not sort output samples by energy

    • subsequent hybrid.ArgMin with the default key="samples.first.energy" might not pick the best sample by energy
    • easily fixed by sorting after compose, with e.g: hybrid.SliceSamples(), or a more explicit hybrid.SliceSamples(sorted_by='energy').
  • hybrid.SplatComposer does not sort input subsamples by energy before composing with a smaller samples set

    • if subsamples generator does not produce sorted sampleset, and is seeded by, say, a single initial state, the output sampleset (containing just one sample) might not be the best

    • easily "fixed" by sorting subsamples generator output

    • but a better fix might be to explode the input sample with hybrid.AggregatedSamples(aggregate=False) before composing with Splat, followed by a truncate with hybrid.SliceSamples(1). So, something like:

      subsampler = (
          hybrid.AggregatedSamples(aggregate=False)
          | hybrid.SimulatedAnnealingProblemSampler()
          | hybrid.SplatComposer()
          | hybrid.SliceSamples(1, ordered_by='energy')
      )
      

      would make sure the best sample is generated, accounting for boundary conditions.

(Originally raised offline by @jackraymond)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant