Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Construction #25

Open
pazadimo opened this issue Jul 22, 2023 · 1 comment
Open

Graph Construction #25

pazadimo opened this issue Jul 22, 2023 · 1 comment

Comments

@pazadimo
Copy link

pazadimo commented Jul 22, 2023

Hi @Richarizardd,

Thanks for sharing the code. I have a question regarding graph construction in latent space:
I was wondering why do you pass coords to the query function for latent graph generation as:

model.fit(features)
a = np.repeat(range(num_patches), radius-1)    
b = np.fromiter(chain(*[model.query(coords[v_idx], topn=radius)[1:] for v_idx in range(num_patches)]),dtype=int)
edge_latent = torch.Tensor(np.stack([a,b])).type(torch.LongTensor)

I wonder if it is the way that DGC model requires for the graph to be constructed?

Thanks

@Vison307
Copy link

I encountered with the same problem. I guess it is bug because once I print our the result of [model.query(coords[v_idx], topn=radius)[1:] for v_idx in range(num_patches)], I find all the queried indexes are the same. (Though I have no idea why the code can be executed successfully as coords and features are in different shapes).

image

After I change coords to features, the results seem to be normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants