Closed NotNANtoN closed 2 years ago
Hi @NotNANtoN, thanks for your interest in our work! you are of course correct, it can be done for efficiency, but the contribution of this fix to the overall runtime is relatively small. Optimizing a single direction takes around 10 minutes either way :)
@NotNANtoN closing this due to duplication, please reopen if necessary :)
https://github.com/hila-chefer/TargetCLIP/blob/b5dd2a492bf436fa26cfa4c02021a957b6a2a5ec/optimization/find_dirs.py#L142-L144
In these lines the latents are recalculated in the nested loop in every inner loop. The latents themselves stay constant though, so it can be done once outside of these loops. Only the augmented latents (latents + direction) need to be recalculated here.