mbhenaff / spectral-lib

45 stars 18 forks source link

Pb matrix dimension on ms_spectral_clustering #7

Open Conchylicultor opened 8 years ago

Conchylicultor commented 8 years ago

When I try to run the generate the laplacien, I obtain a 'Index exceeds matrix dimensions' error on the file ms_spectral_clustering.m at line 10:

function [V, pools] = ms_spectral_clustering(w, wfat, depth, frac, psize)
[...]
    for j=1:depth
        n = floor(frac(j)*size(W{j},1)); % ERROR HERE
[...]

It is logical because of the frac(j):

So the program try to access the second value of a non-vector.

It works if I simply put depth to one but I would like to understand what does the variable depth correspond to ?

wangg12 commented 8 years ago

@Conchylicultor I guess that frac is a scalar, while the code tried to use it as a vector. Change frac{j} to frac may work.

x2mas commented 8 years ago

I guess we can see how he uses it in run_laplacian_2layer.m script: poolsize = [8 8]; poolstride = [4 4];