X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=EM.cpp;h=322a3063ff6596c9b1cce15d037065c8c2c1af85;hb=791b978145b0d22865ee350db9d58072bb99d816;hp=08fc8c7d2400396a8fef40fc945717be4b166e83;hpb=e4514d4b79b1d151a63311303c23bb5333a9ac8d;p=rsem.git diff --git a/EM.cpp b/EM.cpp index 08fc8c7..322a306 100644 --- a/EM.cpp +++ b/EM.cpp @@ -394,9 +394,11 @@ void release(ReadReader **readers, HitContainer **hitvs, doub delete[] mhps; } +int tmp_n; + inline bool doesUpdateModel(int ROUND) { - //return false; // never update, for debugging only - return ROUND <= 20 || ROUND % 100 == 0; + // return ROUND <= 20 || ROUND % 100 == 0; + return ROUND <= 10; } //Including initialize, algorithm and results saving @@ -506,7 +508,7 @@ void EM() { } if (verbose) printf("ROUND = %d, SUM = %.15g, bChange = %f, totNum = %d\n", ROUND, sum, bChange, totNum); - } while (ROUND < MIN_ROUND || totNum > 0 && ROUND < MAX_ROUND); + } while (ROUND < MIN_ROUND || (totNum > 0 && ROUND < MAX_ROUND)); //while (ROUND < MAX_ROUND); if (totNum > 0) fprintf(stderr, "Warning: RSEM reaches %d iterations before meeting the convergence criteria.\n", MAX_ROUND); @@ -571,6 +573,7 @@ void EM() { //calculate expected weights and counts using learned parameters updateModel = false; calcExpectedWeights = true; + for (int i = 0; i <= M; i++) probv[i] = theta[i]; for (int i = 0; i < nThreads; i++) { rc = pthread_create(&threads[i], &attr, E_STEP, (void*)(&fparams[i])); if (rc != 0) { fprintf(stderr, "Cannot create thread %d when calculate expected weights! (numbered from 0)\n", i); exit(-1); }