From 41983ed1c92e953f4672d1cca802ebf872562d6b Mon Sep 17 00:00:00 2001 From: Kanishk Jain Date: Wed, 13 May 2020 18:24:11 -0500 Subject: [PATCH] Update returnCorrectSigma_sparse.m If sigma is inf or nan, the script will go in an infinite loop. Added a check to see if starting sigma is well defined. --- t_sne/returnCorrectSigma_sparse.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t_sne/returnCorrectSigma_sparse.m b/t_sne/returnCorrectSigma_sparse.m index 4396c08..29fee51 100644 --- a/t_sne/returnCorrectSigma_sparse.m +++ b/t_sne/returnCorrectSigma_sparse.m @@ -30,7 +30,9 @@ else test = true; end - + if isinf(sigma) || isnan(sigma) + error('Starting sigma is %0.02f, highGuess is %0.02f and lowGuess is %0.02f. This usually means there are zeros in wavelet amplitudes, could be present in trainingSet too.', sigma, highGuess, lowGuess) + end while test if P > perplexity @@ -65,4 +67,4 @@ - \ No newline at end of file +