[Eeglablist] AMICA Error on Mac

Kelly Michaelis kcmichaelis at gmail.com
Fri Sep 14 09:30:17 PDT 2018


Hi Jason,

Thank you for your input. I am interpolating channels prior to ICA, but I
was under the impression that pcakeep was reducing the data rank
automatically, but I am now realizing I probably need to set it to match
the number of channels minus the interpolated channels. Could this explain
why it performing differently on the same dataset - namely, working
sometimes and failing others?

I'll try setting the pcakeep to the exact number of channels after
interpolation and see where that gets me. Would you recommend trying that
before adjusting the mineig setting?

Thanks!

Kelly



On Thu, Sep 13, 2018 at 4:15 PM, <japalmer29 at gmail.com> wrote:

> Hi Kelly,
>
>
>
> I’m not sure what is causing the illegal instruction error, but it may be
> related somehow to the fact that the data is not well conditioned (minimum
> eigenvalues are around 1e-12), and Amica is not reducing the dimension.
>
>
>
> Two things you might try: (1) add the keyword runamica15( ……, ‘mineig’,
> 1e-9, …) to the amica function call. The default mineig may be too low to
> reduce the dimensions …. There may also be a problem with the mineig
> processing in your binary version which this may help to uncover …
>
>
>
> You can also use the keyword ….., ‘pcakeep’, EEG.nbchan – 3, …. Usually
> you only need to reduce by one dimension (and it is done automatically) due
> to avg reference, but you have multiple dimensions of eigenvalue size
> around 1e-12 ….. are you doing channel interpolation before running Amica?
> ….
>
>
>
> Hope that is helpful, let me know how it goes.
>
>
>
> Best,
>
> Jason
>
>
>
> *From:* Kelly Michaelis <kcmichaelis at gmail.com>
> *Sent:* Thursday, September 13, 2018 12:54 AM
>
> *To:* japalmer29 at gmail.com
> *Cc:* EEGLAB List <eeglablist at sccn.ucsd.edu>
> *Subject:* Re: [Eeglablist] AMICA Error on Mac
>
>
>
> Sure thing! Here you go:
>
>
>
> pop_loadset(): loading file /Users/kcm73/Documents/
> WordsInNoiseProject/EEGData/CohenPipeline/NewPreproc/
> S13newpreproc/preICAfiles/S1302postASRpreICA.set ...
>
> Reading float file '/Users/kcm73/Documents/WordsInNoiseProject/EEGData/
> CohenPipeline/NewPreproc/S13newpreproc/preICAfiles/
> S1302postASRpreICA.fdt'...
>
> Writing data file: /Users/kcm73/Documents/WordsInNoiseProject/EEGData/
> tmpdata15761.fdt
>
>            1 processor name = NEUR-AD-UFDNMP.local
>
>            1 host_num =    258801812
>
>  This is MPI process           1 of           1 ; I am process           1
> of
>
>            1 on node: NEUR-AD-UFDNMP.local
>
>            1  : node root process           1 of           1
>
> Processing arguments ...
>
>  num_files =            1
>
>  FILES:
>
>  /Users/kcm73/Documents/WordsInNoiseProject/EEGData/tmpdata15761.fdt
>
>  num_dir_files =            1
>
>  initial matrix block_size =          128
>
>  do_opt_block =            0
>
>  blk_min =          256
>
>  blk_step =          256
>
>  blk_max =         1024
>
>  number of models =            1
>
>  max_thrds =            2
>
>  use_min_dll =            1
>
>  min dll =   1.000000000000000E-009
>
>  use_grad_norm =            1
>
>  min grad norm =   1.000000000000000E-007
>
>  number of density mixture components =            3
>
>  pdf type =            0
>
>  max_iter =         2000
>
>  num_samples =            1
>
>  data_dim =          128
>
>  field_dim =       471339
>
>  do_history =            0
>
>  histstep =           10
>
>  share_comps =            0
>
>  share_start =          100
>
>  comp_thresh =   0.990000000000000
>
>  share_int =          100
>
>  initial lrate =   5.000000000000000E-002
>
>  minimum lrate =   1.000000000000000E-008
>
>  minimum data covariance eigenvalue =   1.000000000000000E-012
>
>  lrate factor =   0.500000000000000
>
>  initial rholrate =   5.000000000000000E-002
>
>  rho0 =    1.50000000000000
>
>  min rho =    1.00000000000000
>
>  max rho =    2.00000000000000
>
>  rho lrate factor =   0.500000000000000
>
>  kurt_start =            3
>
>  num kurt =            5
>
>  kurt interval =            1
>
>  do_newton =            1
>
>  newt_start =           50
>
>  newt_ramp =           10
>
>  initial newton lrate =    1.00000000000000
>
>  do_reject =            1
>
>  num reject =           15
>
>  reject sigma =    3.00000000000000
>
>  reject start =            2
>
>  reject interval =            1
>
>  write step =           20
>
>  write_nd =            0
>
>  write_LLt =            1
>
>  dec window =            1
>
>  max_decs =            3
>
>  fix_init =            0
>
>  update_A =            1
>
>  update_c =            1
>
>  update_gm =            1
>
>  update_alpha =            1
>
>  update_mu =            1
>
>  update_beta =            1
>
>  invsigmax =    100.000000000000
>
>  invsigmin =   0.000000000000000E+000
>
>  do_rho =            1
>
>  load_rej =            0
>
>  load_c =            0
>
>  load_gm =            0
>
>  load_alpha =            0
>
>  load_mu =            0
>
>  load_beta =            0
>
>  load_rho =            0
>
>  load_comp_list =            0
>
>  do_mean =            1
>
>  do_sphere =            1
>
>  pcakeep =          128
>
>  pcadb =    30.0000000000000
>
>  byte_size =            4
>
>  doscaling =            1
>
>  scalestep =            1
>
> mkdir: /Users/kcm73/Documents/WordsInNoiseProject/EEGData/
> CohenPipeline/NewPreproc/S13newpreproc/postICAfiles/S1302amicaout/: File
> exists
>
>  output directory =
>
>  /Users/kcm73/Documents/WordsInNoiseProject/EEGData/
> CohenPipeline/NewPreproc/S13
>
>  newpreproc/postICAfiles/S1302amicaout/
>
>            1 : setting num_thrds to            2  ...
>
>            1 : using           2 threads.
>
>            1 : node_thrds =            2
>
>  bytes in real =            1
>
>            1 : REAL nbyte =            1
>
>  getting segment list ...
>
>  blocks in sample =       471339
>
>  total blocks =       471339
>
>  node blocks =       471339
>
>  node            1  start: file            1  sample            1  index
>
>            1
>
>  node            1  stop : file            1  sample            1  index
>
>       471339
>
>            1 : data =    25.3650321960449        10.1630601882935
>
>  getting the mean ...
>
>   mean =  -9.756913085498017E-002 -0.956047629660906
>
>   -1.47526619473147
>
>  subtracting the mean ...
>
>  getting the covariance matrix ...
>
>  cnt =       471339
>
>  doing eig nx =          128  lwork =       163840
>
>  minimum eigenvalues =   1.149162121975516E-012  1.895431946218596E-012
>
>   4.236845509809919E-012
>
>  maximum eigenvalues =    9419.65839076655        2570.08584450239
>
>    1758.66520615951
>
>  num eigs kept =          128
>
>  getting the sphering matrix ...
>
>  minimum eigenvalues =   1.149162121975516E-012  1.895431946218596E-012
>
>   4.236845509809919E-012
>
>  maximum eigenvalues =    9419.65839076655        2570.08584450239
>
>    1758.66520615951
>
>  num eigs kept =          128
>
>  sphering the data ...
>
>  numeigs =          128
>
>            1 : Allocating variables ...
>
>            1 : Initializing variables ...
>
>            1 : block size =          128
>
>            1 : entering the main loop ...
>
>  iter     1 lrate =  0.0500000000 LL =  -1.6698055110 nd =  0.0340860203,
> D =   0.67253E-01  0.67253E-01  (  4.88 s,   2.7 h)
>
> Doing rejection ....
>
>  maximum likelihood value =   -1.36397350038783
>
>  minimum likelihood value =   -14.1307674390157
>
>  average likelihood value =   -1.66980551096439
>
>  standard deviation       =   0.420485964745811
>
>  rejecting data with likelihood less than   -2.93126340520182
>
>  rejected         9503  data points so far. Will perform rejection
>    14
>
>   more times at intervals of            1  iterations.
>
>  iter     2 lrate =  0.0500000000 LL =  -1.4654950056 nd =  0.0288690764,
> D =   0.59194E-01  0.59194E-01  (  4.79 s,   2.7 h)
>
> Doing rejection ....
>
>  maximum likelihood value =  -0.977157440409710
>
>  minimum likelihood value =   -2.96524772054921
>
>  average likelihood value =   -1.46549500564456
>
>  standard deviation       =   0.303163728040875
>
>  rejecting data with likelihood less than   -2.37498618976719
>
>  rejected        18918  data points so far. Will perform rejection
>    13
>
>   more times at intervals of            1  iterations.
>
>  iter     3 lrate =  0.0500000000 LL =  -1.3926954878 nd =  0.0275011071,
> D =   0.58424E-01  0.58424E-01  (  4.70 s,   2.6 h)
>
> Doing rejection ....
>
>  maximum likelihood value =  -0.777762136563562
>
>  minimum likelihood value =   -2.55766743708507
>
>  average likelihood value =   -1.39269548775611
>
>  standard deviation       =   0.319846000043196
>
>  rejecting data with likelihood less than   -2.35223348788570
>
>  rejected        24174  data points so far. Will perform rejection
>    12
>
>   more times at intervals of            1  iterations.
>
>  iter     4 lrate =  0.0500000000 LL =  -1.3632471401 nd =  0.0290695735,
> D =   0.94839E-01  0.94839E-01  (  4.66 s,   2.6 h)
>
> Doing rejection ....
>
>  maximum likelihood value =  -0.686256773219760
>
>  minimum likelihood value =   -2.43842460366318
>
>  average likelihood value =   -1.36324714013545
>
>  standard deviation       =   0.330772484995092
>
>  rejecting data with likelihood less than   -2.35556459512072
>
>  rejected        26716  data points so far. Will perform rejection
>    11
>
>   more times at intervals of            1  iterations.
>
>  iter     5 lrate =  0.0500000000 LL =  -1.3482726930 nd =  0.0288899726,
> D =   0.18201E+00  0.18201E+00  (  4.61 s,   2.6 h)
>
> Doing rejection ....
>
>  maximum likelihood value =  -0.646418570096526
>
>  minimum likelihood value =   -2.39934446681889
>
>  average likelihood value =   -1.34827269296910
>
>  standard deviation       =   0.336117397856749
>
>  rejecting data with likelihood less than   -2.35662488653935
>
>  rejected        27789  data points so far. Will perform rejection
>    10
>
>   more times at intervals of            1  iterations.
>
>  iter     6 lrate =  0.0500000000 LL =  -1.3390648637 nd =  0.0275633419,
> D =   0.31228E+00  0.31228E+00  (  4.61 s,   2.6 h)
>
> Doing rejection ....
>
>  maximum likelihood value =  -0.627721013095301
>
>  minimum likelihood value =   -2.38360832281495
>
>  average likelihood value =   -1.33906486365062
>
>  standard deviation       =   0.339889548496796
>
>  rejecting data with likelihood less than   -2.35873350914101
>
>  rejected        28210  data points so far. Will perform rejection
>     9
>
>   more times at intervals of            1  iterations.
>
> /Users/kcm73/Documents/WordsInNoiseProject/EEGData/
> eeglab14_1_2b/plugins/AMICA1.5/amica15mac /Users/kcm73/Documents/
> WordsInNoiseProject/EEGData/CohenPipeline/NewPreproc/
> S13newpreproc/postICAfiles/S1302amicaout/input.param: Illegal instruction
>
> No gm present, setting num_models to 1
>
> No W present, exiting
>
> Reference to non-existent field 'W'.
>
>
>
> Error in runamica15 (line 873)
>
>     weights = mods.W(:,:,1);
>
>
>
> Error in runAMICAonfiles (line 62)
>
>             runamica15(EEG.data, 'num_chans', EEG.nbchan,...
>
>
>
> On Wed, Sep 12, 2018 at 11:50 AM, <japalmer29 at gmail.com> wrote:
>
> Hi Kelly,
>
> Thanks, but could you past the output from the command line (including the
> MPI, etc. output, and up to the point where it fails)?
>
> … It would be helpful to see the output of all the parameter values used
> and relative the minimum covariance eigenvalues, and where it fails exactly
> ….
>
> Thanks,
>
> Jason
>
>
>
> *From:* Kelly Michaelis <kcmichaelis at gmail.com>
> *Sent:* Thursday, September 13, 2018 12:07 AM
> *To:* japalmer29 at gmail.com
> *Cc:* EEGLAB List <eeglablist at sccn.ucsd.edu>
> *Subject:* Re: [Eeglablist] AMICA Error on Mac
>
>
>
> Hi Jason,
>
>
>
> The text output from a failed run is attached. With this particular file,
> I ran the same script again and now it appears to be working. The issue is
> I can't predict when Amica will fail, and I need to run lots of files
> through it. Let me know if you have any suggestions.
>
>
>
> Thanks,
>
> Kelly
>
>
>
>
>
>
>
> On Wed, Sep 12, 2018 at 10:56 AM, <japalmer29 at gmail.com> wrote:
>
> Hi Kelly,
>
> Could you provide the text output of Amica on the run(s) where it fails?
>
> Thanks,
>
> Jason
>
>
>
> *From:* eeglablist <eeglablist-bounces at sccn.ucsd.edu> *On Behalf Of *Kelly
> Michaelis
> *Sent:* Tuesday, September 11, 2018 6:49 AM
> *To:* EEGLAB List <eeglablist at sccn.ucsd.edu>
> *Subject:* [Eeglablist] AMICA Error on Mac
>
>
>
> Hi everyone,
>
>
>
> I have been running into this error with AMICA on mac Sierra 10.12.6 using
> EEGLAB version 14_1_2b. Most of time it works just fine, but then on some
> files it fails and I can't figure out why. The files on which it fails
> don't seem to be different in any observable way. I installed AMICA through
> the GUI, and I have tried uninstalling and reinstalling to no avail.
>
>
>
> I'm hoping one of you can help.
>
>
>
> My script was adapted from Makato's script
> <https://sccn.ucsd.edu/wiki/Makoto's_useful_EEGLAB_code>and is as follows
> (no spaces in path):
>
>
>
>
>
> for iFile = iFiles
>
>
>
>           disp(['starting subject' currentSub 'file' num2str(iFile)])
>
>
>
>           curoutfname = ['S' currentSub '0' num2str(iFile)
> 'postASRpostICA.set'];
>
>
>
>           cutfulloutputfname = fullfile(postICAdir,curoutfname); % so we
> can check if an output file exists already (so we can potentially bail on
> this iteration of a loop so we don't redo work)
>
>
>
>           if exist(cutfulloutputfname,'file')
>
>               disp(['File ' cutfulloutputfname ' already exists,
> bailing...'])
>
>               continue % break?
>
>           end
>
>
>
>             %reload to clear
>
>             eeglab
>
>
>
>             EEG = pop_loadset('filename',['S' currentSub '0'
> num2str(iFile)  'postASRpreICA.set'],'filepath',preICAdir);
>
>
>
>             %  Run AMICA using calculated data rank with 'pcakeep' option
>
>             if isfield(EEG.etc, 'clean_channel_mask')
>
>                 dataRank = min([rank(double(EEG.data'))
> sum(EEG.etc.clean_channel_mask)]);
>
>             else
>
>                 dataRank = rank(double(EEG.data'));
>
>             end
>
>             amicaoutdir = fullfile(postICAdir,['S' currentSub '0'
> num2str(iFile)  'amicaout']);
>
>             runamica15(EEG.data, 'num_chans', EEG.nbchan,...
>
>                 'outdir', amicaoutdir, ... % [ postICAdir '/S' currentSub
> '0' num2str(iFile)  'amicaout'],...
>
>                 'pcakeep', dataRank, 'num_models', 1,...
>
>                 'do_reject', 1, 'numrej', 15, 'rejsig', 3, 'rejint', 1);
>
>             EEG.etc.amica  = loadmodout15(amicaoutdir); %
> fullfile(postICAdir,['S' currentSub '0' num2str(iFile)  'amicaout']));
>
>             EEG.etc.amica.S = EEG.etc.amica.S(1:EEG.etc.amica.num_pcs,
> :); % Weirdly, I saw size(S,1) be larger than rank. This process does not
> hurt anyway.
>
>             EEG.icaweights = EEG.etc.amica.W;
>
>             EEG.icasphere  = EEG.etc.amica.S;
>
>             EEG = eeg_checkset(EEG, 'ica');
>
>
>
>
>
>             EEG = pop_saveset( EEG, 'filename',curoutfname,'filepath',
> postICAdir);
>
>            %EEG = pop_saveset( EEG, 'filename',['S' currentSub '0'
> num2str(iFile)  'postASRpostICA.set'],'filepath', postICAdir);
>
>
>
>             disp(['done with' currentSub 'file' num2str(iFile)])
>
>      end
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20180914/63d3bb99/attachment.html>


More information about the eeglablist mailing list