mirror of
https://github.com/calesthio/OpenMontage.git
synced 2026-08-05 23:24:27 +08:00
The greedy score mixed incommensurate scales: cosine similarity bounded to [-1, 1] against an absolute list index that grows with the pool. For a candidate j positions later to be preferred at the default diversity=0.5, its similarity advantage had to exceed j -- impossible for the non-negative cosines real footage embeddings produce. diversify() therefore returned the input order verbatim, placing exact-duplicate clips in adjacent edit slots, the one thing its docstring promises to prevent. The threshold where the knob started working also depended on pool size (0.66 at 4 candidates, 0.95 at 11). Normalize the position term to [0, 1] so both terms share a scale. The documented endpoints hold exactly as before: diversity=0 returns input order, diversity=1 picks the most mutually dissimilar. Enumerating the position also drops the O(n^2) remaining.index() lookup per candidate. Closes #392