This optimizer is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.
num_results by
lowest energy score. Unlike iterative optimizers (MCMC, beam search), each
proposal batch starts fresh from the captured result state (the prior-stage
results, or the original sequences on the first stage). There is no state
carried between rounds.
Each proposal batch:
- Resets proposals to the captured result state
- Applies all generators sequentially
- Evaluates proposals with constraints
- Updates the sorted results list if any proposals are better than the current worst
- Reports each proposal as its own history iteration
energy_threshold is set, the optimizer stops early once all best
proposals have energy below the threshold.
If filter constraints reject many proposals, the optimizer may return
fewer than
num_results valid results.How It Works
Rejection sampling draws many independent proposals from the same starting point and keeps thenum_results with the lowest energy, carrying no state between draws.
Each batch resets the proposal pool to the initial sequences (the optimizer is stateless), generates B new proposals, scores them, and folds survivors into a buffer of the K = num_results lowest-energy sequences kept in sorted order:
num_samples proposals have been drawn (or the threshold is met). Because each batch restarts from the same initial pool, the search keeps no per-step state and is embarrassingly parallel.
API Reference
Configuration object for RejectionSamplingOptimizer.The Rejection Sampling optimizer generates or receives proposal sequences
and keeps only the best
num_results by lowest energy score. It processes
generated proposals in internal batches and reports each proposal as the
semantic iteration.If filter constraints reject many proposals (returning inf/nan energies),
the optimizer may return fewer than
num_results valid results.integer
required
Generated proposal count; in existing-results mode, candidate cap.
integer
Number of top-scoring candidate designs to retain (lowest energy first). Overrides program count.
string
Derived from the generator list when unset: generated if generators are present.
integer
Proposals scored per internal batch. Inferred from component batch sizes if omitted.
number
Optional early-stop (lower energy = better); stops once every retained candidate is below this.
integer
Random seed for reproducible optimization, generator, and constraint tool streams.
integer
default:"1"
Save history and log progress every N steps. Step 0 and final step always saved.
boolean
default:"False"
Save granular per-proposal results (accept/reject) in history snapshots.
boolean
default:"False"
Emit per-step debug information about proposals, scores, and acceptance through the logger.
Usage
python
python