<div dir="ltr">Dear Jason,<div><br></div><div>If you have time could you please let us know about the update schedule?</div><div><br></div><div>Makoto</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 10, 2015 at 1:02 PM, Norman Forschack <span dir="ltr"><<a href="mailto:forschack@cbs.mpg.de" target="_blank">forschack@cbs.mpg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jason and Makoto,<br>
<br>
in this thread Jason announced a debugged version of amica coming soon. I just wanted to kindly ask whether this is already done or if we should apply the mentioned workaround?<br>
<br>
Thanks a lot!<br>
<span class="HOEnZb"><font color="#888888">Norman<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
----- On Aug 25, 2015, at 6:28 AM, Jason Palmer <a href="mailto:japalmer29@gmail.com">japalmer29@gmail.com</a> wrote:<br>
<br>
> Sorry this line should be:<br>
><br>
><br>
><br>
>>> [W,S,mods] = runamica12(newdat, ....);<br>
><br>
><br>
><br>
><br>
><br>
><br>
> From: Jason Palmer [mailto:<a href="mailto:japalmer@ucsd.edu">japalmer@ucsd.edu</a>]<br>
> Sent: Monday, August 24, 2015 9:17 PM<br>
> To: 'Kevin Tan'; '<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>'; 'EEGLAB List'<br>
> Subject: RE: [Eeglablist] AMICA lrate gets stuck<br>
><br>
><br>
><br>
><br>
> Hi Kevin,<br>
><br>
><br>
><br>
> Sorry, there is a bug in the code tries to take the sqrt of the negative<br>
> eigenvalue (even though that dimension is being removed) making the LL=NaN and<br>
> aborting. The eigenvalue is actually essentially zero, resulting from rank<br>
> deficiency likely due to re-referencing, so more cleaning won’t necessarily<br>
> change the arbitrarily small value to positive, unless you increase the<br>
> dimensionality of the data. I’m currently fixing this bug along with some other<br>
> sphering and PCA issues and will release debugged versions soon.<br>
><br>
><br>
><br>
> For now you can do the work around of sphering before Amica, e.g.<br>
><br>
><br>
><br>
>>> [U,D] = eig(cov(EEG.data(:,:)’));<br>
><br>
>>> U = fliplr(U); D = fliplr(flipud(D)); % make descending order<br>
><br>
>>> dd = diag(D); numeig = sum(dd > 1e-9);<br>
><br>
>>> Sph = diag(sqrt(1./dd(1:numeig))) * U(:,1:numeig)‘;<br>
><br>
>>> newdat = Sph * EEG.data(:,:); % reduce to numeigs dimensions<br>
><br>
>>> [W,S,mods] = runamica12(EEG.data(:,:), ....);<br>
><br>
>>> EEG.icasphere = S*Sph;<br>
><br>
>>> EEG.icaweights = W;<br>
><br>
><br>
><br>
> This should run amica on full rank data an avoid the negative near zero<br>
> eigenvalue problem until it is fixed in the Amica code.<br>
><br>
><br>
><br>
> Best,<br>
><br>
> Jason<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> From: Kevin Tan [ mailto:<a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> ]<br>
> Sent: Monday, August 24, 2015 6:39 PM<br>
> To: Jason Palmer; <a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a> ; EEGLAB List<br>
> Subject: Re: [Eeglablist] AMICA lrate gets stuck<br>
><br>
><br>
><br>
><br>
> Hi Jason,<br>
><br>
><br>
><br>
><br>
><br>
> I'm running into a negative min eigenvalue issue for ~25% of my subjects. This<br>
> results in the binary not exporting anything to the amica output dir, stopping<br>
> the main loop prematurely.<br>
><br>
><br>
><br>
><br>
><br>
> Before running AMICA, the data is fairly aggressively cleaned:<br>
><br>
><br>
> 1) PREP pipeline<br>
><br>
><br>
> 2) remove mastoids & PREP-interpolated chans for rank reduction<br>
><br>
><br>
> 3) 1hz hi-pass<br>
><br>
><br>
> 4) epoch no baseline correction<br>
><br>
><br>
> 5) epoch rejection (ch means deviation, variance, max amplitude dif > 2.5 SDs)<br>
><br>
><br>
><br>
><br>
><br>
> Not sure what else I can do to clean the data to make the eigenvalues positive.<br>
><br>
><br>
><br>
><br>
><br>
> I'm using Biosemi 128ch which is known for dynamic range issues, but I run<br>
> everything in double. Not sure if demeaning each channel would help since it's<br>
> already hi-passed.<br>
><br>
><br>
><br>
><br>
><br>
> Also, not sure if it matters, but AMICA seems to do dimension reduction despite<br>
> me removing channels to make up for 'robust' reference rank reduction.<br>
><br>
><br>
><br>
><br>
><br>
> For the subjects that do run on AMICA, the ICs seem a lot cleaner than Infomax,<br>
> which makes me want to stick to AMICA.<br>
><br>
><br>
><br>
><br>
><br>
> Bad subject log example:<br>
><br>
><br>
><br>
><br>
> 1 : data = -2.3969683647155762 -2.910743236541748<br>
> getting the mean ...<br>
> mean = -7.73083349593588626E-2 -8.98852135101791128E-2 -0.17064473790401868<br>
> subtracting the mean ...<br>
> getting the sphering matrix ...<br>
> cnt = 706560<br>
> doing eig nx = 128 lwork = 163840<br>
> minimum eigenvalues = -4.02618476752492072E-14 0.59534647773064309<br>
> 0.66105027982216646<br>
> maximum eigenvalues = 3718.0696499000956 2980.9762500746847 1012.6027880321443<br>
> num eigs kept = 127<br>
> numeigs = 127<br>
><br>
><br>
><br>
><br>
><br>
> Good subject log example:<br>
><br>
><br>
><br>
><br>
> 1 : data = 3.1855385303497314 5.7855358123779297<br>
> getting the mean ...<br>
> mean = -0.38155908557715745 -0.27761248863920301 -0.3608881566308772<br>
> subtracting the mean ...<br>
> getting the sphering matrix ...<br>
> cnt = 703488<br>
> doing eig nx = 130 lwork = 169000<br>
> minimum eigenvalues = 1.35676859295476523E-13 0.80288149429025613<br>
> 1.1256218532296671<br>
> maximum eigenvalues = 9749.2425686202987 1277.5793884179475 700.98046655297128<br>
> num eigs kept = 129<br>
> numeigs = 129<br>
><br>
><br>
><br>
><br>
><br>
> Many many thanks for the continued help!<br>
><br>
><br>
> –Kevin<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
><br>
><br>
> Kevin Alastair M. Tan<br>
><br>
><br>
> Lab Manager/Research Assistant<br>
><br>
><br>
> Department of Psychology & Center for the Neural Basis of Cognition<br>
><br>
><br>
> Carnegie Mellon University<br>
><br>
><br>
><br>
><br>
><br>
> Baker Hall 434 | <a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> | <a href="http://tarrlab.org/kevintan" rel="noreferrer" target="_blank">tarrlab.org/kevintan</a><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, Aug 21, 2015 at 7:36 PM, Makoto Miyakoshi < <a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a> > wrote:<br>
><br>
><br>
> Dear Kevin and Jason,<br>
><br>
> In the Figure 1 of the following paper, you can see an example of the shift of<br>
> log likelihood of AMICA model along with iteration.<br>
><br>
><br>
><br>
><br>
><br>
> Rissling AJ, Miyakoshi M, Sugar CA, Braff DL, Makeig S, Light GA. (2014).<br>
> Cortical substrates and functional correlates of auditory deviance processing<br>
> deficits in schizophrenia. Neuroimage Clin. Oct 01; 6 424-437<br>
><br>
><br>
><br>
><br>
><br>
> You can see that after 700 iterations there is no 'jump' any more, which may<br>
> correspond to what Jason says reaching to the 'noise floor'. In the beta<br>
> version (?) of AMICA we use here in SCCN, it has a convergence criterion and<br>
> usually stops at around 1000 iterations (smallest I saw was around 700, maximum<br>
> 1500).<br>
><br>
><br>
><br>
><br>
><br>
> Kevin, your questions are always very interesting and I learn a lot from them.<br>
> Thank you Jason for your answers and sharing knowledge.<br>
><br>
><br>
><br>
><br>
><br>
> Makoto<br>
><br>
><br>
><br>
><br>
><br>
> On Mon, Aug 17, 2015 at 4:35 PM, Jason Palmer < <a href="mailto:japalmer29@gmail.com">japalmer29@gmail.com</a> > wrote:<br>
><br>
><br>
><br>
><br>
><br>
> Hi Kevin,<br>
><br>
><br>
><br>
> The Infomax wchange is actually the weight change TIMES the lrate, which is<br>
> going to 1e-7. So the actual final wchange for extended infomax is 1e7 *<br>
> wchange.<br>
><br>
><br>
><br>
> For Amica, if the nd weight change gets down to the 10^-5 magnitude, that is<br>
> usually about the best you can expect with the large number of parameters being<br>
> estimated and the finite computer precision. How small it can get depends on<br>
> the number of samples you have compared to the number of channels. More<br>
> channels = more parameters (nchan^2) = relatively little data = “noisier”<br>
> convergence. More data = better determined optimum = less noisy convergence =<br>
> smaller nd. For 64 channels with 100,000 samples, an nd of 10^-5 sounds<br>
> appropriate.<br>
><br>
><br>
><br>
> However you can change “maxiter” from the default 2000, using the ‘maxiter’<br>
> keyword. This LL should continue to increase and the nd decrease (or at least<br>
> not increase) beyond 2000 iterations, but not significantly. There should be a<br>
> weight change “noise floor” reached, where the LL continues to increase by less<br>
> and less, with possible reductions in lrate, and the nd hovers around the<br>
> “noise floor”.<br>
><br>
><br>
><br>
> Best,<br>
><br>
> Jason<br>
><br>
><br>
><br>
> From: Kevin Tan [mailto: <a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> ]<br>
> Sent: Monday, August 17, 2015 4:21 PM<br>
> To: <a href="mailto:japalmer@ucsd.edu">japalmer@ucsd.edu</a> ; EEGLAB List<br>
> Subject: Re: AMICA lrate gets stuck<br>
><br>
><br>
><br>
><br>
><br>
> Hi Jason,<br>
><br>
><br>
><br>
><br>
><br>
> Thanks so much for the detailed response, really helps clarify what drives the<br>
> lrate changes between the two implementations.<br>
><br>
><br>
><br>
><br>
><br>
> However, for the same dataset processed the same way, AMICA yields higher<br>
> wchange at last iteration (0.0000464763) versus extended Infomax (0.000000).<br>
><br>
><br>
><br>
><br>
><br>
> What are some reasons for this discrepancy, and what can I do improve it? Or is<br>
> weight change between the two implementations not comparable? The entire AMICA<br>
> log is linked in original post if that helps.<br>
><br>
><br>
><br>
><br>
><br>
> Thanks again,<br>
><br>
><br>
> Kevin<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
><br>
><br>
> Kevin Alastair M. Tan<br>
><br>
><br>
> Lab Manager/Research Assistant<br>
><br>
><br>
> Department of Psychology & Center for the Neural Basis of Cognition<br>
><br>
><br>
> Carnegie Mellon University<br>
><br>
><br>
><br>
><br>
><br>
> Baker Hall 434 | <a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> | <a href="http://tarrlab.org/kevintan" rel="noreferrer" target="_blank">tarrlab.org/kevintan</a><br>
><br>
><br>
><br>
><br>
><br>
> On Mon, Aug 17, 2015 at 7:06 PM, Jason Palmer < <a href="mailto:japalmer29@gmail.com">japalmer29@gmail.com</a> > wrote:<br>
><br>
><br>
> Hi Kevin,<br>
><br>
><br>
><br>
> The Amica lrate is not supposed to decrease. The algorithm is a more typical<br>
> gradient descent / Newton optimization algorithm, as opposed to the Infomax<br>
> implementation in runica.m, which uses a type of simulated annealing, deciding<br>
> whether to reduce the learning rate based on the angle between recent update<br>
> directions. The idea there is that this angle will be small when the algorithm<br>
> is near an optimum, as though it is “heading right for it”, so the lrate gets<br>
> reduced if the algorithm is moving “erratically” with a large angle between<br>
> consecutive directions, and doesn’t get reduced if the estimate is “moving<br>
> smoothly”. In practice, this annealing method usually ends up in fact reducing<br>
> the learning rate continuously until it reaches the preset minimum, which<br>
> usually happens at around 500 iterations (500 reductions). I.e. the angle is<br>
> never actually small, so the stopping condition is essentially a maximum number<br>
> of iterations, with the updates being of smaller and smaller magnitude due to<br>
> the lrate decreasing.<br>
><br>
><br>
><br>
> Amica only reduces the lrate if the likelihood decreases. In theory, with a<br>
> reasonable optimum, an optimization algorithm should be able to converge<br>
> without reducing the learning rate. The convergence is measured by the weight<br>
> change (the nd in the amica output) independently of the lrate. That is, the<br>
> weight change should theoretically decrease to zero with a constant<br>
> (sufficiently small) lrate—the higher the better since higher lrate means<br>
> faster convergence. A potential issue with the runica Infomax is early<br>
> convergence if you are starting far from the optimum. Fortunately the optimum<br>
> is usually not far from the “sphering” starting point, so 500 iterations is<br>
> usually enough to converge (even with decreasing lrate).<br>
><br>
><br>
><br>
> So in Amica, the convergence is judged by the “nd”, not the lrate. The lrate<br>
> should be ideally be 0.5 or 1.0, and the LL should be increasing, and the nd<br>
> should be decreasing to zero.<br>
><br>
><br>
><br>
> Hope that is helpful.<br>
><br>
><br>
><br>
> Best,<br>
><br>
> Jason<br>
><br>
><br>
><br>
><br>
><br>
> From: Kevin Tan [mailto: <a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> ]<br>
> Sent: Monday, August 17, 2015 2:31 PM<br>
> To: <a href="mailto:jason@sccn.ucsd.edu">jason@sccn.ucsd.edu</a> ; EEGLAB List<br>
> Subject: AMICA lrate gets stuck<br>
><br>
><br>
><br>
><br>
><br>
> Hi Dr. Palmer & EEGLAB list,<br>
><br>
><br>
><br>
><br>
><br>
> I'm trying out AMICA for artifact rejection and DIPFIT. In my tests, the lrate<br>
> consistently gets stuck at 0.5, stopping only due to max iteration limit. This<br>
> does not happen with extended Infomax.<br>
><br>
><br>
><br>
><br>
><br>
> This happens whether I use the cluster (128 threads) or a normal PC (4 threads).<br>
> I run AMICA 'locally' as it's called within a matlab script already run via<br>
> PBS, not sure if that makes a difference.<br>
><br>
><br>
><br>
><br>
><br>
> Here's the AMICA test stream:<br>
><br>
><br>
> - PREP pipeline<br>
><br>
><br>
> - Remove PREP-interpolated channels<br>
><br>
><br>
> - Remove 1 additional channel for rank consistency<br>
><br>
><br>
> - 1hz FIR hi-pass<br>
><br>
><br>
> - Epoch -500 to 1000ms no baseline correction<br>
><br>
><br>
> - Epoch rejection<br>
><br>
><br>
> - AMICA (using EEG(:,:) -- is it ok to concatenate epochs like this?)<br>
><br>
><br>
><br>
><br>
><br>
> Here's the output log (using the cluster):<br>
><br>
><br>
> <a href="https://cmu.box.com/s/t7j3shmwjj1wj8to80au8mdm6b5676rh" rel="noreferrer" target="_blank">https://cmu.box.com/s/t7j3shmwjj1wj8to80au8mdm6b5676rh</a><br>
><br>
><br>
><br>
><br>
><br>
> Many thanks,<br>
><br>
><br>
> Kevin<br>
><br>
><br>
> --<br>
><br>
><br>
> Kevin Alastair M. Tan<br>
><br>
><br>
> Lab Manager/Research Assistant<br>
><br>
><br>
> Department of Psychology & Center for the Neural Basis of Cognition<br>
><br>
><br>
> Carnegie Mellon University<br>
><br>
><br>
><br>
><br>
><br>
> Baker Hall 434 | <a href="mailto:kevintan@cmu.edu">kevintan@cmu.edu</a> | <a href="http://tarrlab.org/kevintan" rel="noreferrer" target="_blank">tarrlab.org/kevintan</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
> For digest mode, send an email with the subject "set digest mime" to<br>
> <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
><br>
><br>
> Makoto Miyakoshi<br>
> Swartz Center for Computational Neuroscience<br>
> Institute for Neural Computation, University of California San Diego<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
> For digest mode, send an email with the subject "set digest mime" to<br>
> <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div>