Skip to content
Permalink
Browse files

SML: fix whitespace

  • Loading branch information...
nno committed Jul 21, 2019
1 parent a9cfb10 commit 1453144d4b7068f100928f5dd6b74f803175bf55
@@ -95,7 +95,6 @@
freq_radius=0; % 4*2+1=9 freq bins

% >@@>

% Use cosmo_interval_neighborhood to define the frequency neighborhood.
% Assign the result to a variable 'freq_nbrhood'
% How many searchlight centers are in the neighborhood?
@@ -30,7 +30,7 @@
% Use either:
% - cosmo_split and cosmo_stack
% - cosmo_average_samples
% - (for advanced users) cosmo_fx
% - (advanced) cosmo_fx
%
% Assign the result to a variable 'ds_stim'
% >@@>
@@ -23,8 +23,8 @@
% have corresponding elements in the same order
% (such as provided by cosmo_dim_transpose).
% 'nproc', np Use np parallel threads. (Multiple threads may
% speed up computations). If parallel processing is
% not available, or if this option is not provided,
% speed up computations). If parallel processing is
% not available, or if this option is not provided,
% then a single thread is used.
% K,V any other key-value pairs necessary for the measure
% m, for example 'classifier' if
@@ -190,15 +190,15 @@
[test_values,test_splits]=split_half_by_dimension(halves{2},opt);

halves=[]; % let GC do its work

% get number of processes available
nproc_available=cosmo_parallel_get_nproc_available(opt);

% Matlab needs newline character at progress message to show it in
% parallel mode; Octave should not have newline character
environment=cosmo_wtf('environment');
progress_suffix=get_progress_suffix(environment);

% split training data in multiple parts, so that each thread can do a
% subset of all the work
% set options for each worker process
@@ -208,7 +208,7 @@
for p=1:nproc_available
last=min(first+block_size-1,length(train_values));
block_idxs=first:last;

worker_opt=struct();
worker_opt.train_splits=train_splits(block_idxs);
worker_opt.train_values=train_values(block_idxs);
@@ -232,11 +232,11 @@
@run_with_worker,...
worker_opt_cell,...
'UniformOutput',false);

result=cosmo_stack(result_map_cell,1);
cosmo_check_dataset(result);


function result=run_with_worker(worker_opt)
% run dimgen using the options in worker_opt

@@ -251,7 +251,7 @@
nworkers=worker_opt.nworkers;
progress=worker_opt.progress;
progress_suffix=worker_opt.progress_suffix;

% set partitions in case a crossvalidation or correlation measure is
% used
ntrain_elem=cellfun(@(x)size(x.samples,1),train_splits);
@@ -48,12 +48,12 @@
% %|| 'COMNT'
% %|| 'SCALE' }@206x1
% cosmo_disp([pl_layout.pos pl_layout.width pl_layout.height])
% %|| [ -0.408 0.253 0.0358 0.0369
% %|| -0.408 0.284 0.0358 0.0369
% %|| -0.328 0.285 0.0358 0.0369
% %|| : : : :
% %|| 0.373 -0.0821 0.0358 0.0369
% %|| -0.547 -0.5 0.0358 0.0369
% %|| [ -0.408 0.253 0.0358 0.0369
% %|| -0.408 0.284 0.0358 0.0369
% %|| -0.328 0.285 0.0358 0.0369
% %|| : : : :
% %|| 0.373 -0.0821 0.0358 0.0369
% %|| -0.547 -0.5 0.0358 0.0369
% %|| 0.547 -0.5 0.0358 0.0369 ]@206x4
% pl_layout.name
% %|| 'neuromag306planar.lay'
@@ -34,12 +34,12 @@
% %|| 'COMNT'
% %|| 'SCALE' }@104x1
% cosmo_disp([pl_layout.pos pl_layout.width pl_layout.height])
% %|| [ -0.408 0.273 0.0717 0.0791
% %|| -0.328 0.306 0.0717 0.0791
% %|| -0.377 0.179 0.0717 0.0791
% %|| : : : :
% %|| 0.373 -0.104 0.0717 0.0791
% %|| -0.547 -0.5 0.0717 0.0791
% %|| [ -0.408 0.273 0.0717 0.0791
% %|| -0.328 0.306 0.0717 0.0791
% %|| -0.377 0.179 0.0717 0.0791
% %|| : : : :
% %|| 0.373 -0.104 0.0717 0.0791
% %|| -0.547 -0.5 0.0717 0.0791
% %|| 0.547 -0.5 0.0717 0.0791 ]@104x4
% pl_layout.name
% %|| 'neuromag306cmb.lay'
@@ -32,12 +32,12 @@
% %|| 'COMNT'
% %|| 'SCALE' }@206x1
% cosmo_disp([layout.pos layout.width layout.height])
% %|| [ -0.408 0.253 0.0358 0.0369
% %|| -0.408 0.284 0.0358 0.0369
% %|| -0.328 0.285 0.0358 0.0369
% %|| : : : :
% %|| 0.373 -0.0821 0.0358 0.0369
% %|| -0.547 -0.5 0.0358 0.0369
% %|| [ -0.408 0.253 0.0358 0.0369
% %|| -0.408 0.284 0.0358 0.0369
% %|| -0.328 0.285 0.0358 0.0369
% %|| : : : :
% %|| 0.373 -0.0821 0.0358 0.0369
% %|| -0.547 -0.5 0.0358 0.0369
% %|| 0.547 -0.5 0.0358 0.0369 ]@206x4
% layout.name
% %|| 'neuromag306planar.lay'
@@ -58,12 +58,12 @@
% %|| 'COMNT'
% %|| 'SCALE' }@104x1
% cosmo_disp([layout.pos layout.width layout.height])
% %|| [ -0.408 0.273 0.0717 0.0791
% %|| -0.328 0.306 0.0717 0.0791
% %|| -0.377 0.179 0.0717 0.0791
% %|| : : : :
% %|| 0.373 -0.104 0.0717 0.0791
% %|| -0.547 -0.5 0.0717 0.0791
% %|| [ -0.408 0.273 0.0717 0.0791
% %|| -0.328 0.306 0.0717 0.0791
% %|| -0.377 0.179 0.0717 0.0791
% %|| : : : :
% %|| 0.373 -0.104 0.0717 0.0791
% %|| -0.547 -0.5 0.0717 0.0791
% %|| 0.547 -0.5 0.0717 0.0791 ]@104x4
% layout.name
% %|| 'neuromag306cmb.lay'
@@ -83,12 +83,12 @@
% %|| 'COMNT'
% %|| 'SCALE' }@23x1
% cosmo_disp([layout.pos layout.width layout.height])
% %|| [ -0.139 0.428 0.139 0.104
% %|| 0 0.45 0.139 0.104
% %|| 0.139 0.428 0.139 0.104
% %|| : : : :
% %|| 0.139 -0.428 0.139 0.104
% %|| -0.547 -0.5 0.139 0.104
% %|| [ -0.139 0.428 0.139 0.104
% %|| 0 0.45 0.139 0.104
% %|| 0.139 0.428 0.139 0.104
% %|| : : : :
% %|| 0.139 -0.428 0.139 0.104
% %|| -0.547 -0.5 0.139 0.104
% %|| 0.547 -0.5 0.139 0.104 ]@23x4
% layout.name
% %|| 'EEG1020.lay'
@@ -167,7 +167,7 @@

% if we have more processes than parts, run on limited threads
nproc_used=min(numel(nbrhood_cell),nproc_available);

% Matlab needs newline character at progress message to show it in
% parallel mode; Octave should not have newline character
environment=cosmo_wtf('environment');
@@ -1,7 +1,7 @@
function [arr, dim_labels, dim_values]=cosmo_unflatten(ds, dim, varargin)
% unflattens a dataset from 2 to (1+K) dimensions.
%
% [arr, dim_labels]=cosmo_unflatten(ds, [dim, ][,...])
% [arr, dim_labels, dim_values]=cosmo_unflatten(ds, [dim, ][,...])
%
% Inputs:
% ds dataset structure, with fields:
@@ -25,15 +25,15 @@ function test_meeg_neighbors()

% test a subset
ntest=round(n*.5);


% test a subset for fieldtrip
% (fieldtrip is very slow, so testing all would take too long)
ntest_fieldtrip=1;

% visit in random order
rp=randperm(n);

prev_sens='';
for k=1:ntest
prop=props{rp(k)};

0 comments on commit 1453144

Please sign in to comment.
You can’t perform that action at this time.