fnzhan / UNITE

[CVPR 2022 Oral] Marginal Correspondence for Conditional Image Generation, [CVPR 2021] Unbalanced Feature Transport for Exemplar-based Image Translation
193 stars 27 forks source link

Question about the implementation of log_sinkhorn function #2

Closed XiaoqiangZhou closed 3 years ago

XiaoqiangZhou commented 3 years ago

Thanks for sharing such a great work and releasing the codes.

I have a question about the implementation of log_sinkhorn function in sinkhorn.py. Is it should be v = eps * (a + min_eps(u, v, dim=1)) + v instead of v = eps * min_eps(u, v, dim=1) + v in Line 57?

It would be better if you can give a link to the official implementation for this part.

Thanks.

fnzhan commented 3 years ago

Hi, for this part, you can refer to this project https://www.kernel-operations.io/geomloss/ and its code https://github.com/jeanfeydy/geomloss. I will also add acknowledgment to this project in the end.

XiaoqiangZhou commented 3 years ago

@fnzhan Thanks for your reply.

Besides, could you please point out the detailed place you implement the optimal transport in your code. e.g., the inference process (Equ. 1 to 5 in paper) and loss supervision (Equ. 8 in paper)? I find many OT examples in the util folder, but they are not used in the main training/testing code.

fnzhan commented 3 years ago

@fnzhan Thanks for your reply.

Besides, could you please point out the detailed place you implement the optimal transport in your code. e.g., the inference process (Equ. 1 to 5 in paper) and loss supervision (Equ. 8 in paper)? I find many OT examples in the util folder, but they are not used in the main training/testing code.

The implementation can be found in https://github.com/fnzhan/UNITE/tree/main/models/networks/geomloss , and 245-299 in https://github.com/fnzhan/UNITE/blob/main/models/networks/correspondence.py . The loss is consistent with CoCosNet. The OT examples in util have no relation with the implementation of this work, just ignore it.

XiaoqiangZhou commented 3 years ago

@fnzhan Thanks for your quick reply~

245-299 in https://github.com/fnzhan/UNITE/blob/main/models/networks/correspondence.py

This guidance really helps me a lot. Thanks!