get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm (Operator)

Name

get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm — Berechnen des Informationsgehaltes der vorverarbeiteten Merkmalsvektoren eines GMM.

Signatur

get_prep_info_class_gmm( : : GMMHandle, Preprocessing : InformationCont, CumInformationCont)

Herror T_get_prep_info_class_gmm(const Htuple GMMHandle, const Htuple Preprocessing, Htuple* InformationCont, Htuple* CumInformationCont)

void GetPrepInfoClassGmm(const HTuple& GMMHandle, const HTuple& Preprocessing, HTuple* InformationCont, HTuple* CumInformationCont)

HTuple HClassGmm::GetPrepInfoClassGmm(const HString& Preprocessing, HTuple* CumInformationCont) const

HTuple HClassGmm::GetPrepInfoClassGmm(const char* Preprocessing, HTuple* CumInformationCont) const

HTuple HClassGmm::GetPrepInfoClassGmm(const wchar_t* Preprocessing, HTuple* CumInformationCont) const   (Nur Windows)

static void HOperatorSet.GetPrepInfoClassGmm(HTuple GMMHandle, HTuple preprocessing, out HTuple informationCont, out HTuple cumInformationCont)

HTuple HClassGmm.GetPrepInfoClassGmm(string preprocessing, out HTuple cumInformationCont)

Beschreibung

get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm berechnet den Informationsgehalt der mit der durch PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing gegebenen Vorverarbeitung transformierten Komponenten der Trainingsvektoren. PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing kann auf 'principal_components'"principal_components""principal_components""principal_components""principal_components" oder 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates" gesetzt werden. Die zugrundeliegenden Vorverarbeitungen sind bei create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm beschrieben. Der Informationsgehalt wird aus die Variation der transformierten Komponenten der Trainingsvektoren berechnet, d.h. er wird rein aufgrund der Trainingsdaten unabhängig von einer Fehlerrate bei einer Klassifikation der Trainingsdaten berechnet. Der Informationsgehalt wird für alle relevanten Komponenten der transformierten Merkmalsvektoren (NumComponentsNumComponentsNumComponentsNumComponentsnumComponents für 'principal_components'"principal_components""principal_components""principal_components""principal_components" und 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates", siehe create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm) in InformationContInformationContInformationContInformationContinformationCont zurückgegeben. Der Informationsgehalt wird als eine Zahl zwischen 0 und 1 dargestellt. Ein prozentualer Informationsgehalt kann leicht durch Multiplikation mit 100 berechnet werden. Der kumulierte Informationsgehalt der ersten n Komponenten wird in der n-ten Komponente von CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont zurückgegeben, d.h. CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont enthält die Summen der ersten n Elemente von InformationContInformationContInformationContInformationContinformationCont. Um get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm verwenden zu können, müssen mit add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm oder read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmm genügend viele Trainingsmuster zu dem durch GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle gegebenen GMM hinzugefügt werden.

InformationContInformationContInformationContInformationContinformationCont und CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont können dazu verwendet werden, um zu entscheiden, wie viele Komponenten der transformierten Merkmalsvektoren relevante Information enthalten. Ein oft verwendetes Kriterium ist z.B. zu verlangen, dass die transformierten Daten x% (z.B. 90%) der Daten enthalten sollten. Dies kann leicht anhand des ersten Wertes von CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont, der über x% liegt, bestimmt werden. Der so erhaltene Wert kann bei einem neuerlichen Aufruf von create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm als NumComponentsNumComponentsNumComponentsNumComponentsnumComponents verwendet werden. Da zum Aufruf von get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm schon ein GMM mit create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm erzeugt werden muss, also auch ein initialer Wert von NumComponentsNumComponentsNumComponentsNumComponentsnumComponents bei create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm angegeben werden muss, aber bei Verwendung von get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm typischerweise noch nicht bekannt ist, wie viele Komponenten relevant sind, empfiehlt sich folgendes zweistufiges Vorgehen, um NumComponentsNumComponentsNumComponentsNumComponentsnumComponents zu bestimmen: In einem ersten Schritt wird ein GMM mit der maximalen Anzahl von NumComponentsNumComponentsNumComponentsNumComponentsnumComponents (NumComponentsNumComponentsNumComponentsNumComponentsnumComponents für 'principal_components'"principal_components""principal_components""principal_components""principal_components" und 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates") erzeugt. Dann werden die Trainingsmuster zu dem GMM hinzugefügt und mit write_samples_class_gmmwrite_samples_class_gmmWriteSamplesClassGmmWriteSamplesClassGmmWriteSamplesClassGmm in Datei gespeichert. Anschließend wird mit get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm der Informationsgehalt der Komponenten und somit NumComponentsNumComponentsNumComponentsNumComponentsnumComponents bestimmt. Danach wird ein neues GMM mit der gewünschten Anzahl Komponenten erzeugt, und die abgespeicherten Trainingsdaten mit read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmm wieder eingelesen. Hierauf wird das GMM mit train_class_gmmtrain_class_gmmTrainClassGmmTrainClassGmmTrainClassGmm trainiert.

Ausführungsinformationen

Parameter

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandle (input_control)  class_gmm HClassGmm, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des GMM.

PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Art der Vorverarbeitung (Transformation) der Merkmalsvektoren.

Defaultwert: 'principal_components' "principal_components" "principal_components" "principal_components" "principal_components"

Werteliste: 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates", 'principal_components'"principal_components""principal_components""principal_components""principal_components"

InformationContInformationContInformationContInformationContinformationCont (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Relativer Informationsgehalt der transformierten Merkmalsvektoren.

CumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont (output_control)  real-array HTupleHTupleHtuple (real) (double) (double) (double)

Kumulierter Informationsgehalt der transformierten Merkmalsvektoren.

Beispiel (HDevelop)

* Create the initial GMM
create_class_gmm (NumDim, NumClasses, NumCenters, 'full',\
                  'principal_components', NumComponents, 42, GMMHandle)
* Generate and add the training data
for J := 0 to NumData-1 by 1
    * Generate training features and classes
    * Data = [...]
    * ClassID = [...]
    add_sample_class_gmm (GMMHandle, Data, ClassID, Randomize)
endfor
write_samples_class_gmm (GMMHandle, 'samples.gtf')
* Compute the information content of the transformed features
get_prep_info_class_gmm (GMMHandle, 'principal_components',\
                         InformationCont, CumInformationCont)
* Determine Comp by inspecting InformationCont and CumInformationCont
* NumComponents = [...]
* Create the actual GMM
create_class_gmm (NumDim, NumClasses, NumCenters, 'full',\
                  'principal_components', NumComponents, 42, GMMHandle)
* Train the GMM
read_samples_class_gmm (GMMHandle, 'samples.gtf')
train_class_gmm (GMMHandle, 200, 0.0001, 0.0001, Regularize, Centers, Iter)
write_class_gmm (GMMHandle, 'classifier.gmm')

Ergebnis

Sind die Parameterwerte korrekt, dann liefert get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Falls get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmm den Fehler 9211 (Matrix ist nicht positiv definit) bei PreprocessingPreprocessingPreprocessingPreprocessingpreprocessing = 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates" zurückliefert, bedeutet dies typischerweise, dass für die verschiedenen Klassen zu wenige Trainingsmuster gespeichert worden sind.

Vorgänger

add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmm, read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmm

Nachfolger

clear_class_gmmclear_class_gmmClearClassGmmClearClassGmmClearClassGmm, create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmm

Literatur

Christopher M. Bishop: „Neural Networks for Pattern Recognition“; Oxford University Press, Oxford; 1995.
Andrew Webb: „Statistical Pattern Recognition“; Arnold, London; 1999.

Modul

Foundation