|
| 1 | +# Implementation audit |
| 2 | + |
| 3 | +This document records the source-to-release checks performed before writing the |
| 4 | +public tutorial. It separates the executed model graph from inactive notebook |
| 5 | +experiments and from preprocessing that remains outside the package. |
| 6 | + |
| 7 | +## Reference hierarchy |
| 8 | + |
| 9 | +1. Cell-state architecture: executed cells 10, 14, 15, and 19 in |
| 10 | + `MultiFlow/generation/best_record/Joint_model_VAE_AE_encoder_cross_attention.ipynb`. |
| 11 | +2. Perturbation architecture: the production leave-one-cell-type-out runner |
| 12 | + `run_leave_one_out_all_celltypes.py`, which incorporates the intended zero |
| 13 | + control embedding missing from the earlier exploratory notebook cell. |
| 14 | +3. Concatenation ablation: the active graph in |
| 15 | + `Joint_model_VAE_diffusion_encoder_cross_attention_concat.ipynb`, represented |
| 16 | + by the corrected research module `multiflow_generation/model.py`. |
| 17 | +4. Protocol defaults and encoder boundary: manuscript Methods plus the executed |
| 18 | + training and sampling cells. |
| 19 | + |
| 20 | +## Numerical graph checks |
| 21 | + |
| 22 | +The release models were initialized with the reference state tensors after a |
| 23 | +semantic key mapping and evaluated on identical random inputs. The largest |
| 24 | +absolute output difference was `0.0` for all three checks: |
| 25 | + |
| 26 | +| Release model | Reference | State entries | Max. absolute difference | |
| 27 | +|---|---|---:|---:| |
| 28 | +| `CellStateFlow` | executed cross-attention notebook module | 87 | 0.0 | |
| 29 | +| `PerturbationFlow` | production leave-one-out runner | 88 | 0.0 | |
| 30 | +| `ConditionalConcatFlow` | corrected concat notebook module | 47 | 0.0 | |
| 31 | + |
| 32 | +The executable audit is kept outside the package test suite because it points |
| 33 | +to the local research tree. The package tests independently cover model |
| 34 | +construction, training, sampling, checkpoint migration, H5MU validation, and |
| 35 | +CLI round trips. |
| 36 | + |
| 37 | +## Training and sampling checks |
| 38 | + |
| 39 | +- target path: linear interpolation between Gaussian source and encoded target; |
| 40 | +- objective: RNA MSE plus ATAC MSE with equal weight; |
| 41 | +- source noise: independent for the cross-attention and perturbation models; |
| 42 | +- concat ablation source: one shared Gaussian state for both modalities; |
| 43 | +- optimization: Adam, learning rate `1e-4`, batch size 512, 600 epochs; |
| 44 | +- latent normalization: per-feature mean and standard deviation estimated from |
| 45 | + training cells and inverted after sampling; |
| 46 | +- generation solver: midpoint ODE integration with 100 steps; |
| 47 | +- perturbation solver: midpoint ODE integration with 50 steps; and |
| 48 | +- perturbation control: fixed class index 0 with an exact zero embedding. |
| 49 | + |
| 50 | +## Explicit boundaries and corrected exploratory cells |
| 51 | + |
| 52 | +- The public package begins with paired encoder latents. It does not yet bundle |
| 53 | + the paper RNA VAE, multimodal ATAC autoencoder, decoders, feature files, or |
| 54 | + encoder scale factors. |
| 55 | +- The package does not create leave-one-cell-type-out splits or apply |
| 56 | + benchmark-specific latent/profile corrections. These operations must remain |
| 57 | + explicit and training-only. |
| 58 | +- The exploratory concat notebook assigns `x1_atac = rna_latent` in one cell. |
| 59 | + This is inconsistent with paired RNA/ATAC training and with the surrounding |
| 60 | + code. The corrected research module and release use `atac_latent`; the concat |
| 61 | + model is labeled as an ablation rather than the canonical paper model. |
| 62 | +- The earliest perturbation notebook initialized the control embedding as a |
| 63 | + trainable random vector. The later production runner fixes and masks row 0, |
| 64 | + matching the manuscript definition `p = 0`; the release follows that |
| 65 | + production behavior. |
| 66 | +- The previous CLI fallback of 200 ODE steps did not match the paper protocol. |
| 67 | + The release now selects 100 steps for cell-state generation and 50 for |
| 68 | + perturbation unless an explicit override is recorded. |
| 69 | + |
| 70 | +These boundaries are also stated in the README and tutorial so users cannot |
| 71 | +mistake generated latent states for decoded biological profiles. |
0 commit comments