ajabri / videowalk

Repository for "Space-Time Correspondence as a Contrastive Random Walk" (NeurIPS 2020)

Home Page:http://ajabri.github.io/videowalk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cycle length bounds

vadimkantorov opened this issue · comments

@ajabri I have a question about the cycle building code https://github.com/ajabri/videowalk/blob/master/code/model.py#L147-L148:

for i in list(range(1, len(A12s))):
    g = A12s[:i+1] + A21s[:i+1][::-1]

What is semantics of the variable i? Is it cycle half-length? then why is the boundary len(A12s) and not len(A12s) + 1? If it's cycle half-length minus 1, then why is the starting index 1 and not 0?

For i == 1, the code seems to be building a cycle over 3 frames with 4 edges:

# For i == 1
g = [A12[0], A12[1], A21[1], A21[0]] 
# corresponding F0 -> F1 -> F2 -> F1 -> F0

Is this correct?

E.g. for the boundary case when we have just two frames and want to build a cycle of two edges (frame1 -> frame2 -> frame1), len(A12s) == len(A21s) == 1, but in the existing code this seems not possible.

I propose to change the starting bound to 0 so the loop reads for i in range(len(A12s)):

Thank you!

You're right that the current code skips the shortest cycle. This design is just something that was present in all of my experiments, so I left it in. I haven't thoroughly compared including the shortest cycle too.