spectral-lib
spectral-lib copied to clipboard
Pb matrix dimension on ms_spectral_clustering
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 inbuild_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 I guess that frac is a scalar, while the code tried to use it as a vector. Change frac{j} to frac may work.
I guess we can see how he uses it in run_laplacian_2layer.m script: poolsize = [8 8]; poolstride = [4 4];