flexs.baselines.models.noisy_abstract_model

Define the noisy abstract model class.

class flexs.baselines.models.noisy_abstract_model.NoisyAbstractModel(landscape, signal_strength=0.9)[source]

Bases: flexs.model.Model

Behaves like a ground truth model.

It corrupts a ground truth model with noise, which is modulated by distance to already measured sequences.

Specifically, $hat{f}(x) = alpha^d f(x) + (1 - alpha^d) epsilon$ where $epsilon$ is drawn from an exponential distribution with mean $f(x)$ $d$ is the edit distance to the closest measured neighbor, and $alpha$ is the signal strength.

train(sequences, labels)[source]

Training step simply stores sequences and labels in a dictionary for future lookup.