IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 9, 2013, 6:36:20 PM (13 years ago)
Author:
watersc1
Message:

Fixed psMM errors in handling NAN values. I've added a wrapper function that censors these values before passing the valie data into the prior version of the functions. This is necessary as a mask won't work (there are matrix operations I don't want to bother sorting masking for).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMixtureModels.h

    r35394 r35785  
    22#define PS_MIXTUREMODELS_H
    33
     4// These are the recommended functions to call.  They in turn call code
     5// that scans the input data matrix/image and censored data points with
     6// non-finite values.  The censored data is then passed to the next set
     7// of functions.
    48
    59bool psMMkmeans(psImage *D,
     
    2428             double *V);
    2529
     30// These functions assume that the input data matrix/image is cleaned of
     31// non-finite values.  They should work identically as the ones above on
     32// data that is well defined.
     33bool psMMkmeansUncensored(psImage *D,
     34                          int dim,
     35                          long N,
     36                          psVector *modes,
     37                          psImage *means,
     38                          int m,
     39                          int *iterations,
     40                          double *V);
     41
     42bool psMMGMMUncensored(psImage *D,
     43                       int dim,
     44                       long N,
     45                       psVector *modes,
     46                       psImage *means,
     47                       psArray *sigma,
     48                       psVector *pi,
     49                       psImage *P,
     50                       int m,
     51                       int *iterations,
     52                       double *V);
     53
     54// This function does the classification in five stages:
     55//  1) pass data to K-means code with m modes for initial values.
     56//  2) pass data+K-mean values to GMM code with m modes for best values.
     57//  3) repeat K-means pass with m-1 modes.
     58//  4) repeat GMM pass with m-1 modes.
     59//  5) calculate Pvalue that the model with m modes is better than that with m-1
    2660bool psMMClass(psImage *D,
    2761               int dim,
     
    3468               int m,
    3569               double *Pval);
    36  
     70
     71
     72// These functions are one dimensional equivalent wrappers of the above functions.
     73// The psVector data is inserted into the appropriate sized psImage structure to
     74// avoid having to do so in each program calling this library.  Since this is the
     75// only special case (2-dim is a matrix, n-dim is matrix as well), no other wrappers
     76// are needed.
    3777bool psMM1Dkmeans(psVector *D,
    3878                  long N,
Note: See TracChangeset for help on using the changeset viewer.