Skip to content

Bug Fixes in sampler.py to correct sequence score mismatch #14

@carlossolugen

Description

@carlossolugen

I identified and fixed several bugs in the sampler.py file which resulted in:

  1. Accepting proposed sequences even when accepted is False.
  2. Lost alignment between the sequences in the chains and their scores.
    In combination, these issues resulted in a mismatch between the scores returned by the sampler, and those obtained by rescoring the same sequences with the model used for sampling.

The fixes make sure that only proposed sequences for which accepted is True are accepted, and that the sampler state is correctly updated to reflect this, ensuring ongoing alignment between the sequences and their scores throughout the optimization.

To reproduce the issue, it suffices to run EvoProtGrad with any expert, e.g., ESM2, to produce all the sequences and scores found, and then rescoring the sequences with the same expert. You will find that a decent percent of sequences end up with non-matching scores.

I will create a pull request shortly with my bugfixes to sampler.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions