branching bug

This commit is contained in:
Johannes Stelzer 2023-01-08 12:18:54 +01:00
parent c3df20d37e
commit 27097c24ed
1 changed files with 7 additions and 7 deletions

View File

@ -268,14 +268,14 @@ class LatentBlending():
list_nmb_branches = np.round(np.logspace(np.log10(2), np.log10(nmb_branches_final), nmb_injections+1)).astype(int)
# Cleanup. There should be at least nmb_mindist diffusion steps between each injection and list_nmb_branches increases
list_injection_idx_clean = [list_injection_idx[0]]
list_nmb_branches_clean = [list_nmb_branches[0]]
for idx in range(1, len(list_injection_idx)):
if list_injection_idx[idx] - list_injection_idx[idx-1] >= nmb_mindist and list_nmb_branches[idx] > list_nmb_branches[idx-1]:
list_injection_idx_clean.append(list_injection_idx[idx])
list_nmb_branches_clean.append(list_nmb_branches[idx])
list_injection_idx_clean = [list_injection_idx[0]]
for idx_injection, nmb_branches in zip(list_injection_idx[1:], list_nmb_branches[1:]):
if idx_injection - list_injection_idx_clean[-1] >= nmb_mindist and nmb_branches > list_nmb_branches_clean[-1]:
list_nmb_branches_clean.append(nmb_branches)
list_injection_idx_clean.append(idx_injection)
list_nmb_branches_clean[-1] = nmb_branches_final
list_injection_idx_clean = [int(l) for l in list_injection_idx_clean]
list_nmb_branches_clean = [int(l) for l in list_nmb_branches_clean]