// file: $isip/class/pr/VerifyHMM/VerifyHMM.h // version: $Id: VerifyHMM.h 10505 2006-03-16 18:28:07Z may $ // // make sure definitions are only made once // #ifndef ISIP_VERIFY_HMM #define ISIP_VERIFY_HMM #ifndef ISIP_HIDDEN_MARKOV_MODEL #include #endif // VerifyHMM: a class that contains the interface for the verification // system training and verification // class VerifyHMM : public HiddenMarkovModel { //-------------------------------------------------------------------------- // // public constants // //-------------------------------------------------------------------------- public: // define the class name // static const String CLASS_NAME; // define the algorithm choices // enum ALGORITHM { VERIFY = 0, TRAIN, MODEL_CREATION, INITIALIZE, MIXTURE_SPLITTING, DEF_ALGORITHM = VERIFY }; // define the implementation choices // enum IMPLEMENTATION { LIKELIHOOD_RATIO = 0, BAUM_WELCH, GLOBAL, VARIANCE_SPLITTING, LIKELIHOOD, DEF_IMPLEMENTATION = LIKELIHOOD_RATIO }; // define the static NameMap objects // static const NameMap IMPL_MAP; static const NameMap ALGO_MAP; //---------------------------------------- // // i/o related constants // //---------------------------------------- static const String PARAM_IMPOSTER_LANGUAGE_MODEL; static const String PARAM_IMPOSTER_STATISTICAL_MODEL_POOL; static const String PARAM_DECISION_THRESHOLDS; //---------------------------------------- // // default values and arguments // //---------------------------------------- // default values // static const String DEF_DECISION_THRESHOLDS; //--------------------------------------------------------------------------- // // protected data // //--------------------------------------------------------------------------- protected: // algorithm name // ALGORITHM algorithm_d; // implementation name // IMPLEMENTATION implementation_d; // imposter language model file // Filename imp_lm_file_d; // imposter statistical model pool file // Filename imp_smp_file_d; // decision thresholds // VectorFloat decision_thresholds_d; // hierarchical search for imposter models. note that for speaker // models, we use the search-engine from the base HMM class // HierarchicalSearch imp_search_engine_d; // Language model for imposter models. note that for speaker // models, we use the language model from the base HMM class // LanguageModelIHD imp_lm_d; // static memory manager // static MemoryManager mgr_d; //--------------------------------------------------------------------------- // // required public methods // //--------------------------------------------------------------------------- public: // method: name // static const String& name() { return CLASS_NAME; } // other static methods // static bool8 diagnose(Integral::DEBUG debug_level); // constructor(s)/destructor(s) // ~VerifyHMM(); VerifyHMM(); VerifyHMM(const VerifyHMM& arg); // method: assign // bool8 assign(const VerifyHMM& arg) { return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__); } // i/o methods // int32 sofSize() const; bool8 read(Sof& sof, int32 tag, const String& name = CLASS_NAME); bool8 write(Sof& sof, int32 tag, const String& name = CLASS_NAME) const; bool8 readData(Sof& sof, const String& pname = DEF_PARAM, int32 size = SofParser::FULL_OBJECT, bool8 param = true, bool8 nested = false); bool8 writeData(Sof& sof, const String& param = DEF_PARAM) const; // method: new // static void* operator new(size_t size) { return mgr_d.get(); } // method: new[] // static void* operator new[](size_t size) { return mgr_d.getBlock(size); } // method: delete // static void operator delete(void* ptr) { mgr_d.release(ptr); } // method: delete[] // static void operator delete[](void* ptr) { mgr_d.releaseBlock(ptr); } // method: setGrowSize // static bool8 setGrowSize(int32 grow_size) { return mgr_d.setGrow(grow_size); } //--------------------------------------------------------------------------- // // class-specific public methods // set methods // //--------------------------------------------------------------------------- // method: getAlgorithm // ALGORITHM getAlgorithm() { return algorithm_d; } // method: setAlgorithm // bool8 setAlgorithm(ALGORITHM arg) { return (algorithm_d = arg); } // method: getImplementation // IMPLEMENTATION getImplementation() { return implementation_d; } // method: setImplementation // bool8 setImplementation(IMPLEMENTATION arg) { return (implementation_d = arg); } // method: getImposterLanguageModelFile // Filename& getImposterLanguageModelFile() { return imp_lm_file_d; } // method: setImposterLanguageModelFile // bool8 setImposterLanguageModelFile(const Filename& arg) { return imp_lm_file_d.assign(arg); } // method: getImposterStatisticalModelPoolFile // Filename& getImposterStatisticalModelPoolFile() { return imp_smp_file_d; } // method: setImposterStatisticalModelPoolFile // bool8 setImposterStatisticalModelPoolFile(const Filename& arg) { return imp_smp_file_d.assign(arg); } // method: getDecisionThresholds // VectorFloat getDecisionThresholds() { return decision_thresholds_d; } // method: setDecisionThresholds // bool8 setDecisionThresholds(const VectorFloat& decision_thresholds) { decision_thresholds_d = decision_thresholds; return true; } //--------------------------------------------------------------------------- // // class-specific public methods: // computational methods // //--------------------------------------------------------------------------- // run methods // bool8 run(Sdb& sdb); // load methods // bool8 load(); //--------------------------------------------------------------------------- // // private methods // //--------------------------------------------------------------------------- private: bool8 verify(Sdb& sdb); bool8 verifylr(Sdb& sdb); bool8 verifyl(Sdb& sdb); }; //end of include file // #endif