Permalink
Browse files

modified hyperalignment measure to ignore scaling

data if scale=0.0
Hypearlignment algorithm is changed to use the same reference in the last step
  • Loading branch information...
1 parent 507dfd8 commit 4accd1334bf69274ddff9a0aea880c4579fa52be @swaroopgj committed with swaroop Mar 18, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −1 mvpa2/algorithms/hyperalignment.py
  2. +4 −3 mvpa2/measures/hyperalignment.py
@@ -221,7 +221,8 @@ def __call__(self, datasets):
#ds_new = ds.copy() # shallow copy so we could assign new labels
#zscore(ds_new, chunks_attr=None)
- ds_temp = (commonspace*ndatasets - data_mapped[i])/(ndatasets-1)
+ ds_temp = commonspace
+ #ds_temp = (commonspace*ndatasets - data_mapped[i])/(ndatasets-1)
if params.zscore_common:
zscore(ds_temp, chunks_attr=None)
ds_new.targets = ds_temp #commonspace #PRJ ds_temp#
@@ -15,9 +15,10 @@ def __call__(self, dataset):
ds = []
nsamples = dataset.nsamples/self.nsubjs
seed_index = np.where(dataset.fa.roi_seed)
- dist = np.sum(np.abs(dataset.fa.voxel_indices-dataset.fa.voxel_indices[seed_index]), axis=1)
- dist = np.exp(-(self.scale*dist/np.float(max(dist)) )**2)
- dataset.samples = dataset.samples*dist
+ if self.scale>0.0:
+ dist = np.sum(np.abs(dataset.fa.voxel_indices-dataset.fa.voxel_indices[seed_index]), axis=1)
+ dist = np.exp(-(self.scale*dist/np.float(max(dist)) )**2)
+ dataset.samples = dataset.samples*dist
for i in range(self.nsubjs):
ds.append(dataset[0+i*nsamples:nsamples*(i+1),])
for ref_ds in range(self.nsubjs):

0 comments on commit 4accd13

Please sign in to comment.