DANMF icon indicating copy to clipboard operation
DANMF copied to clipboard

Input

Open rishabhramteke opened this issue 6 years ago • 20 comments

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

rishabhramteke avatar Jun 25 '19 06:06 rishabhramteke

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

smartyfh avatar Jun 26 '19 05:06 smartyfh

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

rishabhramteke avatar Jun 26 '19 05:06 rishabhramteke

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

rishabhramteke avatar Jun 26 '19 05:06 rishabhramteke

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.

smartyfh avatar Jun 26 '19 06:06 smartyfh

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

rishabhramteke avatar Jun 26 '19 06:06 rishabhramteke

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

smartyfh avatar Jun 26 '19 06:06 smartyfh

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 avatar Jul 02 '19 01:07 rishabhramteke

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

rishabhramteke avatar Jul 02 '19 02:07 rishabhramteke

And Line 120 too

rishabhramteke avatar Jul 02 '19 02:07 rishabhramteke

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.

smartyfh avatar Jul 06 '19 11:07 smartyfh

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.

earthat avatar Aug 23 '19 12:08 earthat

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.

smartyfh avatar Aug 23 '19 12:08 smartyfh

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.

earthat avatar Aug 23 '19 12:08 earthat

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.

smartyfh avatar Aug 23 '19 13:08 smartyfh

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 avatar Aug 23 '19 13:08 earthat

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.

earthat avatar Aug 24 '19 01:08 earthat

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 avatar Aug 24 '19 08:08 smartyfh

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.

smartyfh avatar Aug 24 '19 08:08 smartyfh

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|.

earthat avatar Aug 24 '19 09:08 earthat

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!

smartyfh avatar Aug 24 '19 09:08 smartyfh