Skip to content

Input #3

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

Open
rishabhramteke opened this issue Jun 25, 2019 · 20 comments
Open

Input #3

rishabhramteke opened this issue Jun 25, 2019 · 20 comments

Comments

@rishabhramteke
Copy link

How are you giving input A ? Can you show me the results that you achieved on various datasets?
Both input and output.

@smartyfh
Copy link
Owner

The input A denotes the adjacency matrix of a network. For a network with n nodes, A is an n-by-n matrix, and its (i, j)-entry is 1 or 0. If nodes i and j are connected, then A(i, j) is 1, otherwise, it's 0. thanks

@rishabhramteke
Copy link
Author

Yes. I know that. I am asking how are you giving input to the code.

@rishabhramteke
Copy link
Author

Also can you send me the results that you got using this code on various datasets.

@smartyfh
Copy link
Owner

If the data are stored in CSV, we can use csvread to load data (like this: A = csvread('adjacencyMatrix.csv', 1, 1)). Sorry I cannot send you the results, for I do not store the intermediate results.

@rishabhramteke
Copy link
Author

the thing is the code is not working that way. it is giving undefined variable error and i dont understand why

@smartyfh
Copy link
Owner

Which variable? Do you mean A? U can check what your A is in matlab.

@rishabhramteke
Copy link
Author

Which Dataset did you use to run the code ? please run the code and send me the results. It is not working as you said it is supposed o be.

@rishabhramteke
Copy link
Author

Also, there seems to be Incorrect dimensions for matrix multiplication in Line 93 of DANMF

@rishabhramteke
Copy link
Author

And Line 120 too

@smartyfh
Copy link
Owner

smartyfh commented Jul 6, 2019

Pls check our paper, the implementation is just the same as what the paper shows. Anyway, the implementation is quite simple. If you are not so familiar with Matlab, you can also use the python version (it is the same as the Matlab version). Maybe it will help you.

@earthat
Copy link

earthat commented Aug 23, 2019

Hi @smartyfh

if we have the matrix of n*k then how would we calculate the adjacency matrix as square matrix is suitable for it.

@smartyfh
Copy link
Owner

Hi @smartyfh

if we have the matrix of n*k then how would we calculate the adjacency matrix as square matrix is suitable for it.

Hi, could you pls make it clearer? Sorry that I couldn't get your question.

@earthat
Copy link

earthat commented Aug 23, 2019

the input matrix A is adjacency matrix which is a square one. My dataset has 359 samples with 2173 features. The adjacency matrix can't be calculated for it. In that case, can you please suggest how to modify this code for it.

@smartyfh
Copy link
Owner

the input matrix A is adjacency matrix which is a square one. My dataset has 359 samples with 2173 features. The adjacency matrix can't be calculated for it. In that case, can you please suggest how to modify this code for it.

Well, actually, you can replace the adjacency matrix A by any shape matrix X. However, the update rule may need to be modified as well. Because when deriving the updating rules, I used the property A = A^T. In your case, this property does not hold any more. So maybe you can follow the same procedure to derive the new updating rules.

@earthat
Copy link

earthat commented Aug 23, 2019

In it there are two major issues:

-if we don't use the adjacency matrix, then the ShallowNMF gives the NaN values

  • using any shape matrix has another issue of D = diag(sum(A)); L = D - A;. It doesn't support other than square. The L is further used in the cost function

@earthat
Copy link

earthat commented Aug 24, 2019

I found the graph regularizer L can be dropped. but the other issue of using matrix other than adjacency in the input of DNMF is NaN output in factors U and V.

Please suggest any hint for this.

@smartyfh
Copy link
Owner

In it there are two major issues:

-if we don't use the adjacency matrix, then the ShallowNMF gives the NaN values

  • using any shape matrix has another issue of D = diag(sum(A)); L = D - A;. It doesn't support other than square. The L is further used in the cost function

The input matrix of ShallowNMF can be of any shape. But it should be nonnegative.

For the graph regularization term, you can omit it directly. Or you can construct your own graph just like spectral clustering, then you can calculate the Laplacian matrix L.

@smartyfh
Copy link
Owner

I found the graph regularizer L can be dropped. but the other issue of using matrix other than adjacency in the input of DNMF is NaN output in factors U and V.

Please suggest any hint for this.

I guess the reason is that your data have negative values.

@earthat
Copy link

earthat commented Aug 24, 2019

I found the graph regularizer L can be dropped. but the other issue of using matrix other than adjacency in the input of DNMF is NaN output in factors U and V.
Please suggest any hint for this.

I guess the reason is that your data have negative values.

Yes, you are absolutely correct. My features have negative values. Though I replaced the shallowNMF with nnmf from MATLAB. It created another issue for me. The Vi update has the dimensional issue due to the mismatch in P and A. The memory units in the first layer should be equal to the number of samples or we can see it empirically.

Unfortunately, the same error occurred if I input the matrix as |A|.

@smartyfh
Copy link
Owner

I found the graph regularizer L can be dropped. but the other issue of using matrix other than adjacency in the input of DNMF is NaN output in factors U and V.
Please suggest any hint for this.

I guess the reason is that your data have negative values.

Yes, you are absolutely correct. My features have negative values. Though I replaced the shallowNMF with nnmf from MATLAB. It created another issue for me. The Vi update has the dimensional issue due to the mismatch in P and A. The memory units in the first layer should be equal to the number of samples or we can see it empirically.

Unfortunately, the same error occurred if I input the matrix as |A|.

Firstly, since your input is not square matrix, the updating rules should be modified accordingly.

Secondly, the ShallowNMF module shouldn't be replaced.

Thirdly, the input should be non-negative.

You can just create an adjacency matrix and run the code to see whether it works. Thanks!

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