spectral-lib icon indicating copy to clipboard operation
spectral-lib copied to clipboard

Pb matrix dimension on ms_spectral_clustering

Open Conchylicultor opened this issue 9 years ago • 2 comments

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):

  • frac is an integer frac = stride / poolsize; defined in build_graph_laplacian_space.m
  • j iterate over depth, which is 2 by default.

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 ?

Conchylicultor avatar Mar 31 '16 16:03 Conchylicultor

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

wangg12 avatar Apr 01 '16 07:04 wangg12

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

x2mas avatar Apr 08 '16 13:04 x2mas