Changeset 35798
- Timestamp:
- Jul 11, 2013, 8:00:59 AM (13 years ago)
- Location:
- trunk/psLib/src/math
- Files:
-
- 2 edited
-
psMinimizeLMM.c (modified) (3 diffs)
-
psMixtureModels.c (modified) (4 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizeLMM.c
r35767 r35798 501 501 psTrace("psLib.math", 5, "Iteration number %d. (max iterations is %d).\n", min->iter, min->maxIter); 502 502 psTrace("psLib.math", 5, "Last delta is %f. stop if < %f, accept if < %f\n", min->lastDelta, min->minTol, min->maxTol); 503 psTrace("psLib.math.dLinear", 5, "Iteration number %d. (max iterations is %d).\n", min->iter, min->maxIter); 504 psTrace("psLib.math.dLinear", 5, "Last delta is %f. stop if < %f, accept if < %f\n", min->lastDelta, min->minTol, min->maxTol); 503 505 504 506 // set a new guess for Alpha, Beta, Params … … 519 521 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (1)"); 520 522 } 523 if (psTraceGetLevel("psLib.math.dLinear") >= 6) { 524 p_psImagePrint(psTraceGetDestination(), Alpha, "alpha guess (1)"); 525 p_psVectorPrint(psTraceGetDestination(), Beta, "beta guess (1)"); 526 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (1)"); 527 p_psVectorPrint(psTraceGetDestination(), params, "params guess (1)"); 528 } 521 529 522 530 // calculate Chisq for new guess, update Alpha & Beta … … 538 546 539 547 psTrace("psLib.math.dLinear", 5, "last chisq: %f, new chisq %f, delta: %f, dLinear: %f, rho: %f, lambda: %g\n", min->value, Chisq, min->lastDelta, dLinear, rho, lambda); 540 548 if (psTraceGetLevel("psLib.math.dLinear") >= 6) { 549 p_psImagePrint(psTraceGetDestination(), Alpha, "alpha guess (2)"); 550 p_psVectorPrint(psTraceGetDestination(), Beta, "beta guess (2)"); 551 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (2)"); 552 } 541 553 // dump some useful info if trace is defined 542 554 if (psTraceGetLevel("psLib.math") >= 6) { -
trunk/psLib/src/math/psMixtureModels.c
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/eam_branches/ipp-20130307/psLib/src/math/psMixtureModels.c merged eligible /branches/eam_branches/ipp-20130419/psLib/src/math/psMixtureModels.c merged eligible /branches/eam_branches/ipp-20130509/psLib/src/math/psMixtureModels.c merged eligible /tags/ipp-test-20130710/psLib/src/math/psMixtureModels.c merged eligible /branches/czw_branch/20101203/psLib/src/math/psMixtureModels.c 29907-30631 /branches/czw_branch/20120906/psLib/src/math/psMixtureModels.c 34410-34786 /branches/eam_branches/ipp-20101103/psLib/src/math/psMixtureModels.c 29657-29920 /branches/eam_branches/ipp-20101205/psLib/src/math/psMixtureModels.c 29959-30585 /branches/eam_branches/ipp-20110213/psLib/src/math/psMixtureModels.c 30628-31149 /branches/eam_branches/ipp-20110404/psLib/src/math/psMixtureModels.c 31166-31444 /branches/eam_branches/ipp-20110505/psLib/src/math/psMixtureModels.c 31458-31658 /branches/eam_branches/ipp-20110710/psLib/src/math/psMixtureModels.c 31852-32345 /branches/eam_branches/ipp-20110906/psLib/src/math/psMixtureModels.c 32363-32631 /branches/eam_branches/ipp-20111110/psLib/src/math/psMixtureModels.c 32645-32694 /branches/eam_branches/ipp-20120405/psLib/src/math/psMixtureModels.c 33724-33957 /branches/eam_branches/ipp-20120601/psLib/src/math/psMixtureModels.c 33977-34079 /branches/eam_branches/ipp-20120627/psLib/src/math/psMixtureModels.c 34099-34256 /branches/eam_branches/ipp-20120805/psLib/src/math/psMixtureModels.c 34292-34401 /branches/eam_branches/ipp-20120905/psLib/src/math/psMixtureModels.c 34407-34747 /branches/eam_branches/ipp-20121130/psLib/src/math/psMixtureModels.c 34755-34841 /branches/eam_branches/ipp-20121219/psLib/src/math/psMixtureModels.c 34857-35096 /branches/eam_branches/ipp-20130207/psLib/src/math/psMixtureModels.c 35125-35236 /branches/haf_add201112/psLib/src/math/psMixtureModels.c 32980-33029
r35785 r35798 116 116 psVector *offsets) { 117 117 // Allocate offset vector 118 offsets = psVectorRecycle(offsets,in->numRows,PS_TYPE_S32);118 // offsets = psVectorRecycle(offsets,in->numRows,PS_TYPE_S32); 119 119 120 120 *Ncensored = 0; … … 169 169 psImage *Dcensored = psMMCensorData(D,&Ncensored,offsets); 170 170 171 psVector *tempModes = psVectorAlloc(N - Ncensored,PS_TYPE_F32); 172 bool success = psMMkmeansUncensored(Dcensored, 173 dim, 174 N - Ncensored, 175 tempModes, 176 means, 177 m, 178 iterations, 179 V); 171 172 bool success; 180 173 if (Ncensored == 0) { // We can directly return the modes and means calculated 181 if (modes) { 182 psFree(modes); 183 } 184 modes = psMemIncrRefCounter(tempModes); 174 success = psMMkmeansUncensored(Dcensored, 175 dim, 176 N, 177 modes, 178 means, 179 m, 180 iterations, 181 V); 185 182 } 186 183 else { 184 psVector *tempModes = psVectorAlloc(N - Ncensored,PS_TYPE_F32); 185 success = psMMkmeansUncensored(Dcensored, 186 dim, 187 N - Ncensored, 188 tempModes, 189 means, 190 m, 191 iterations, 192 V); 193 187 194 if (!modes) { 188 195 modes = psVectorAlloc(N,PS_TYPE_F32); 189 196 } 190 197 191 198 psVectorInit(modes,NAN); 192 199 for (int i = 0; i < N - Ncensored; i++) { 193 200 modes->data.F32[i - offsets->data.S32[i]] = tempModes->data.F32[i]; 194 201 } 202 psFree(tempModes); 195 203 } 196 204 psFree(offsets); 197 205 psFree(Dcensored); 198 psFree(tempModes); 206 199 207 return(success); 200 208 } … … 373 381 // We need to scan the input for invalid d 374 382 long Ncensored; 375 psVector *offsets = psVectorAlloc(N,PS_TYPE_ F32);383 psVector *offsets = psVectorAlloc(N,PS_TYPE_S32); 376 384 psImage *Dcensored = psMMCensorData(D,&Ncensored,offsets); 377 378 psVector *tempModes = psVectorAlloc(N - Ncensored,PS_TYPE_F32); 379 psImage *tempP = psImageAlloc(m,N - Ncensored,PS_TYPE_F32); 380 bool success = psMMGMMUncensored(Dcensored, 381 dim, 382 N - Ncensored, 383 tempModes, 384 means, 385 sigma, 386 pi, 387 tempP, 388 m, 389 iterations, 390 V); 385 bool success; 391 386 if (Ncensored == 0) { // We can directly return the modes and means calculated 392 if (modes) { 393 psFree(modes); 394 } 395 if (P) { 396 psFree(P); 397 } 398 modes = psMemIncrRefCounter(tempModes); 399 P = psMemIncrRefCounter(tempP); 387 success = psMMGMMUncensored(Dcensored, 388 dim, 389 N, 390 modes, 391 means, 392 sigma, 393 pi, 394 P, 395 m, 396 iterations, 397 V); 400 398 } 401 399 else { 400 psVector *tempModes = psVectorAlloc(N - Ncensored,PS_TYPE_F32); 401 psImage *tempP = psImageAlloc(m,N - Ncensored,PS_TYPE_F32); 402 403 success = psMMGMMUncensored(Dcensored, 404 dim, 405 N, 406 tempModes, 407 means, 408 sigma, 409 pi, 410 tempP, 411 m, 412 iterations, 413 V); 414 415 402 416 if (!modes) { 403 417 modes = psVectorAlloc(N,PS_TYPE_F32); … … 415 429 } 416 430 } 431 psFree(tempModes); 432 psFree(tempP); 417 433 } 418 434 psFree(offsets); 419 435 psFree(Dcensored); 420 psFree(tempModes);421 psFree(tempP);422 436 return(success); 423 437 } -
Property svn:mergeinfo
set to (toggle deleted branches)
Note:
See TracChangeset
for help on using the changeset viewer.
