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

generate assignment.npy #5

Open
spiritcommonsix opened this issue Oct 26, 2023 · 2 comments
Open

generate assignment.npy #5

spiritcommonsix opened this issue Oct 26, 2023 · 2 comments

Comments

@spiritcommonsix
Copy link

I don't understand "Dartboard Projection & MSA" in the paper and the assignment.npy is given in the code. Could you share the method of generating assignment.npy? Thanks for your work!

@G-H-Li
Copy link

G-H-Li commented Jan 7, 2024

@spiritcommonsix Have you figured out how assignment.npy is generated, please?

After reading the article carefully, I realized that there is a dimensional inconsistency between the way the assignment matrix is calculated according to the article, and assignment.npy.

It is written below in the article:

For a certain station i, we unify the formulation of the dartboard projection by introducing a projection matrix Ai ∈ RM×N which denotes how nearby stations are mapped to M regions bound by the line fragments and circles, where each entry ajk ≥ 0 denotes the likelihood that the k-th station belongs to the region j. Ai has each row summing to one and each non-zero entry in the same row is evenly distributed (like average pooling).

According to my understanding, assignment.npy should be a stacked matrix of N sites Ai. assignment.npy has dimension (N, N, M). The text says that the dimension of Ai is (M, N), so the Ai matrix should have undergone a transpose operation and then been stacked.

Also, according to what is written in the article:

Ai has each row summing to one and each non-zero entry in the same row is evenly distributed (like average pooling).

Then I wrote a code to kern the values in assignment.npy as follows:

if __name__ == '__main__':
    a = np.load(os.path.join(Config().dataset_dir, 'assignment.npy'))  # read assignment.npy
    a = torch.from_numpy(a[:, 0])
    row = a.transpose(1, 0)
    row_sums = row.sum(axis=1)
    print(row_sums)

But the result I get is not for every row M, where the values sum to 1.
image

I'm not sure if I'm understanding this correctly. I hope the author can correct me if there is a problem.
At the same time, I also hope very much that the authors can publicize the code for generating mask.npy and assignemnt.npy, so that it is convenient for people to migrate and reproduce the paper, and further improve the academic impact of this article.

Looking forward to the author's reply.

@guoanli
Copy link

guoanli commented Dec 7, 2024

@G-H-Li
Do you know how the code for generating mask.npy and assignment.npy works?

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

3 participants