quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_stat.a #include <MixtureModel.h> MixtureModel(MODE mode = DEF_MODE); MixtureModel(const MixtureModel& arg); boolean eq(const MixtureModel& arg) const; boolean assign(const MixtureModel& arg); boolean setWeights(const VectorFloat& arg); boolean getWeights(VectorFloat& arg) const; boolean normalizeWeights(float norm = DEF_NORM); boolean add(StatisticalModelBase& ptr);
description:MixtureModel model; GaussianModel gauss; UniformModel uniform; VectorFloat weights(L"79, 5"); model.setWeights(weights); model.add(gauss); model.add(uniform);
where |
static const String CLASS_NAME;
static const String DEF_PARAM;
static const String PARAM_WEIGHTS;
static const String PARAM_MODELS;
static const float MIN_SCORE = -1e100;
static const float DEF_NORM = 1.0;
static const long ERR = 60200;
SingleLinkedListmodels_d;
VectorFloat weights_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
setDebug is inherited from base class
~MixtureModel();
MixtureModel(MODE mode = DEF_MODE);
MixtureModel(const MixtureModel& arg);
boolean assign(const MixtureModel& arg);
MixtureModel& operator=(const MixtureModel& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readAccumulator(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean writeAccumulator(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean readAccumulatorData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeAccumulatorData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean readOccupancies(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean readOccupanciesData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean eq(const MixtureModel& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE cmode = Integral::DEF_CMODE);
boolean setModels(SingleLinkedList& new_models);
boolean setWeights(const VectorFloat& arg);
SingleLinkedList& getModels();
VectorFloat& getDaWeights();
boolean getWeights(VectorFloat& arg) const;
boolean add(StatisticalModelBase& ptr);
boolean initializeWeights();
boolean isNormalized(float norm = DEF_NORM) const;
boolean normalizeWeights(float norm = DEF_NORM);
boolean assign(const StatisticalModelBase& arg);
boolean eq(const StatisticalModelBase& arg);
boolean setMode(MODE mode);
const String& className() const;
boolean init();
float getLikelihood(const VectorFloat& input);
float getLogLikelihood(const VectorFloat& input);
double getOccupancy();
boolean setOccupancy(double arg);
boolean setAccessCount(long arg);
long getAccessCount();
boolean resetAccumulators();
boolean initialize(VectorFloat& param);
boolean accumulate(VectorFloat& param);
boolean accumulate(VectorFloat& param, VectorFloat& data, boolean precomp);
boolean update(VectorFloat& param);
// declare the MixtureModel object // MixtureModel model; // declare GaussianModel and UniformModel objects // GaussianModel gauss; UniformModel uniform; // set the GaussianModel object // VectorFloat mean(L"1, 2, 3"); MatrixFloat covar(3, 3, L"4, 5, 6", Integral::DIAGONAL); gauss.setMean(mean); gauss.setCovariance(covar); // set the UniformModel object // VectorFloat min(L"-1, -2, -3"); VectorFloat max(L"1, 2, 3"); uniform.setMin(min); uniform.setMax(max); // add model objects into the MixtureModel object // model.add(gauss); model.add(uniform); // declare the input vector // VectorFloat input; input.assign(L"-1.050, -7.709, -2.303"); // score the input vector // Float score = model.getLikelihood(input);