Add partial-diffusion (SDEdit) seeding for binder generation and refinement - #55
Open
ssiddhantsharma wants to merge 1 commit into
Open
Conversation
Seed the reverse process from an existing binder at an intermediate flow time instead of pure noise (RFdiffusion partial_t analog), enabling variant generation / refinement under FK steering. Backward-compatible: no search.seed => unchanged. - ProductSpaceFlowMatcher.seed_state: SDEdit forward marginal at start_step - fk_steering: reads search.seed, re-spaces step_checkpoints, seeds via seed_state - utils.pdb_utils.encode_seed: chain -> (bb_ca nm, local_latents); optional target_chain aligns the seed to the target CA-COM frame so docked pose survives - tests/test_seed.py: weights-free seed_state tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds partial diffusion (SDEdit) to the flow-matching binder pipeline: instead of starting
the reverse process from pure noise, seed it from an existing binder at an intermediate
flow time and denoise the rest of the way. This enables variant generation and
refinement of a known design under FK steering — the flow-matching analog of
RFdiffusion's
partial_t.Fully backward-compatible: with no
search.seedin the config, generation is unchanged(de novo from noise).
Motivation
The search stack already supports partial reverse integration (
partial_simulationrunsbetween
step_checkpoints), but generation always begins from pure noise, so there was no wayto start from — and stay near — an existing binder. Partial diffusion is the natural way to
(a) sample sequence/backbone variants of a good design and (b) refine a design toward a reward
(affinity/selectivity) under FK steering, which de-novo generation can't do.
What's added
flow_matching/product_space_flow_matcher.pyseed_state(clean, mask, ts, start_step)— the SDEdit forward marginalx_t = (1−t)·noise + t·cleanatt = ts[dm][start_step], built from the existinginterpolate+sample_noise. The partial-diffusion analog of de-novosample_noise.search/fk_steering.pyutils/pdb_utils.pyencode_seed(autoencoder, pdb_path, chain, target_chain=None)— encodes a chain to(bb_ca [n,3] nm, local_latents [n,8])viaautoencoder.encode()["mean"]. Whentarget_chainis given, shifts the seed into the target's CA-COM frame (matchingCoordsTensorCenteringTransform) so the docked pose is preserved; otherwise warns.tests/test_seed.pyseed_state.Design notes
partial_simulation(start_step, end_step, ts)already supports partial reverse —seed_statebuilds
x_tat exactly thetits first step consumes (for step in range(start_step, end_step): t = ts[dm][step]), so no changes to the integrator.(1−t)·x_0 + t·x_1(x_0 = noise, x_1 = clean), so largerstart_step(t → 1) stays nearer the seed; smaller explores more.
start_stepis a unitless scheduleindex — calibrate
renoise_frac ↔ Cα-RMSDempirically.target_chainalignment shifts onlybb_ca.Usage
Validation
Unit tests (
tests/test_seed.py, weights-free,python -m pytest tests/test_seed.py -v):Component / integration (against the released
complexa+complexa_aecheckpoints):encode_seedon the real AE:latent_dim=8, encode→decode sequence recovery = 1.000,latents unit-scale (global std ≈ 1.2) — consistent with the OT noise prior and the decoder's
latent space.
complexa generate(fk-steering + AF2 reward, target-conditioned) withsearch.seedset — the seed is encoded,step_checkpointsre-spaced[0,25,50]→[40,50],seed_stateinitializes the trajectory, generation completes.is unchanged by it, at the origin and with the complex translated +50 Å off-origin
(aligned seed identical in both frames → docked pose invariant to absolute placement).