flexs.baselines.explorers.bo¶
BO explorer.
-
class
flexs.baselines.explorers.bo.BO(model, rounds, sequences_batch_size, model_queries_per_batch, starting_sequence, alphabet, log_file=None, method='EI', recomb_rate=0)[source]¶ Bases:
flexs.explorer.ExplorerEvolutionary Bayesian Optimization (Evo_BO) explorer.
- Algorithm works as follows:
- for N experiment rounds
- recombine samples from previous batch if it exists and measure them,
otherwise skip
Thompson sample starting sequence for new batch while less than B samples in batch
Generate model_queries_per_batch/sequences_batch_size samples If variance of ensemble models is above twice that of the starting
sequence
Thompson sample another starting sequence
-
class
flexs.baselines.explorers.bo.GPR_BO(model, rounds, sequences_batch_size, model_queries_per_batch, starting_sequence, alphabet, log_file=None, seq_proposal_method='Thompson')[source]¶ Bases:
flexs.explorer.ExplorerExplorer using GP-based Bayesian Optimization.
Uses Gaussian process with RBF kernel on black box function. IMPORTANT: This explorer is not limited by any virtual screening restriction, and is used to find the unrestricted performance of Bayesian Optimization techniques in small landscapes.
Reference: http://krasserm.github.io/2018/03/21/bayesian-optimization/
-
propose_sequences(measured_sequences)[source]¶ Propose batch_size samples.
- Return type
Tuple[ndarray,ndarray]
-
propose_sequences_via_greedy()[source]¶ Propose a batch of new sequences.
Based on greedy in the expectation of the Gaussian posterior.
-
propose_sequences_via_thompson()[source]¶ Propose a batch of new sequences. Based on Thompson sampling with a Gaussian posterior.
-