KlassenKlassenKlassenKlassen | | | | Operatoren

get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm (Operator)

Name

get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmget_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)

Herror get_prep_info_class_gmm(const HTuple& GMMHandle, const HTuple& Preprocessing, HTuple* InformationCont, HTuple* CumInformationCont)

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

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

void HOperatorSetX.GetPrepInfoClassGmm(
[in] VARIANT GMMHandle, [in] VARIANT Preprocessing, [out] VARIANT* InformationCont, [out] VARIANT* CumInformationCont)

VARIANT HClassGmmX.GetPrepInfoClassGmm(
[in] BSTR Preprocessing, [out] VARIANT* CumInformationCont)

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_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm berechnet den Informationsgehalt der mit der durch PreprocessingPreprocessingPreprocessingPreprocessingPreprocessingpreprocessing gegebenen Vorverarbeitung transformierten Komponenten der Trainingsvektoren. PreprocessingPreprocessingPreprocessingPreprocessingPreprocessingpreprocessing kann auf 'principal_components'"principal_components""principal_components""principal_components""principal_components""principal_components" oder 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates""canonical_variates" gesetzt werden. Die zugrundeliegenden Vorverarbeitungen sind bei create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm 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 (NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents für 'principal_components'"principal_components""principal_components""principal_components""principal_components""principal_components" und 'canonical_variates'"canonical_variates""canonical_variates""canonical_variates""canonical_variates""canonical_variates", siehe create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm) in InformationContInformationContInformationContInformationContInformationContinformationCont 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 CumInformationContCumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont zurückgegeben, d.h. CumInformationContCumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont enthält die Summen der ersten n Elemente von InformationContInformationContInformationContInformationContInformationContinformationCont. Um get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm verwenden zu können, müssen mit add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmm oder read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmm genügend viele Trainingsmuster zu dem durch GMMHandleGMMHandleGMMHandleGMMHandleGMMHandleGMMHandle gegebenen GMM hinzugefügt werden.

InformationContInformationContInformationContInformationContInformationContinformationCont und CumInformationContCumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont 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 CumInformationContCumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont, der über x% liegt, bestimmt werden. Der so erhaltene Wert kann bei einem neuerlichen Aufruf von create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm als NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents verwendet werden. Da zum Aufruf von get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm schon ein GMM mit create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm erzeugt werden muss, also auch ein initialer Wert von NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents bei create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm angegeben werden muss, aber bei Verwendung von get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm typischerweise noch nicht bekannt ist, wie viele Komponenten relevant sind, empfiehlt sich folgendes zweistufiges Vorgehen, um NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents zu bestimmen: In einem ersten Schritt wird ein GMM mit der maximalen Anzahl von NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents (NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents für 'principal_components'"principal_components""principal_components""principal_components""principal_components""principal_components" und 'canonical_variates'"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_gmmWriteSamplesClassGmmwrite_samples_class_gmmWriteSamplesClassGmmWriteSamplesClassGmm in Datei gespeichert. Anschließend wird mit get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm der Informationsgehalt der Komponenten und somit NumComponentsNumComponentsNumComponentsNumComponentsNumComponentsnumComponents bestimmt. Danach wird ein neues GMM mit der gewünschten Anzahl Komponenten erzeugt, und die abgespeicherten Trainingsdaten mit read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmm wieder eingelesen. Hierauf wird das GMM mit train_class_gmmtrain_class_gmmTrainClassGmmtrain_class_gmmTrainClassGmmTrainClassGmm trainiert.

Parallelisierung

Parameter

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandleGMMHandle (input_control)  class_gmm HClassGmm, HTupleHTupleHClassGmm, HTupleHClassGmmX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle des GMM.

PreprocessingPreprocessingPreprocessingPreprocessingPreprocessingpreprocessing (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Art der Vorverarbeitung (Transformation) der Merkmalsvektoren.

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

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

InformationContInformationContInformationContInformationContInformationContinformationCont (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Relativer Informationsgehalt der transformierten Merkmalsvektoren.

CumInformationContCumInformationContCumInformationContCumInformationContCumInformationContcumInformationCont (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (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 = [...]
clear_class_gmm (GMMHandle)
* 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')
clear_class_gmm (GMMHandle)

Ergebnis

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

Falls get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmm den Fehler 9211 (Matrix ist nicht positiv definit) bei PreprocessingPreprocessingPreprocessingPreprocessingPreprocessingpreprocessing = 'canonical_variates'"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_gmmAddSampleClassGmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmm, read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmm

Nachfolger

clear_class_gmmclear_class_gmmClearClassGmmclear_class_gmmClearClassGmmClearClassGmm, create_class_gmmcreate_class_gmmCreateClassGmmcreate_class_gmmCreateClassGmmCreateClassGmm

Literatur

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

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren