[pymvpa] Hyperalignment: SVD did not converge

Kiefer Katovich kieferk at stanford.edu
Fri Apr 27 21:41:49 UTC 2012

Hi again,

Next question about Hyperalignment: why does singular value
decomposition not converge sometimes, and what does it imply about my

Some brief background on what I am doing first:

I have 5 subject's brain data loaded into PyMVPA and have set each of
their targets according to labels when i load them in using
fmri_dataset. There are 8 different "classes" that can be applied to
each TR, and each subject has an equal number of TRs labelled with
each class, though not in the same order.

After this, I zscore to the "rest" TR using zscore(ds,
param_est=('targets', [0])), where [0] in this case is the code for
the rest TR.

Then I do a feature selection using OneWayAnova, detailed below:

tail_selector = FixedNElementTailSelector(2000, tail='upper',
mode='select', sort=False)
anova = OneWayAnova()
anova_features = [anova(ds) for ds in datasets]
feature_selector = [StaticFeatureSelection(tail_selector(fs)) for fs
in anova_features]
fs_datasets = [feature_selector[x].forward(ds) for x, ds in enumerate(datasets)]

Then, I hyperalign with these "feature selected" datasets:

hyper = Hyperalignment(alignment=ProcrusteanMapper())
hyper_mapper = hyper(datasets=fs_datasets)

This works on subsets of the five subjects I have, but when I try to
run it on all 5 of my subjects, I get an error describing that SVN did
not converge.

Why does SVN converge with fewer subjects, but when I increase the
number it is no longer able to? Does that mean that something is wrong
with my data or the way in which I am classifying TRs? I am not sure
what singular value decomposition not converging actually means in the
context of hyperalignment and the procrustean transformation.

Any help would be appreciated. I'm happy to provide more info on the
data and processing stream.

The actual traceback of the error I get is below in case it's useful:

File "python2.7/site-packages/mvpa2/algorithms/hyperalignment.py",
line 203, in __call__
    m.train(ds_new) # ds_temp)

  File "python2.7/site-packages/mvpa2/base/learner.py", line 119, in train
    result = self._train(ds)

  File "python2.7/site-packages/mvpa2/mappers/procrustean.py", line
174, in _train

  File "python2.7/site-packages/numpy/linalg/linalg.py", line 1321, in svd
    raise LinAlgError, 'SVD did not converge'

numpy.linalg.linalg.LinAlgError: SVD did not converge

Thanks so much,


More information about the Pkg-ExpPsy-PyMVPA mailing list