get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm (Operator)

Name

get_prep_info_class_gmmT_get_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm — 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)

def get_prep_info_class_gmm(gmmhandle: HHandle, preprocessing: str) -> Tuple[Sequence[float], Sequence[float]]

Beschreibung

get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm 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_gmmCreateClassGmmCreateClassGmmCreateClassGmmcreate_class_gmm 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 (NumComponentsNumComponentsNumComponentsNumComponentsnumComponentsnum_components 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_gmmCreateClassGmmCreateClassGmmCreateClassGmmcreate_class_gmm) in InformationContInformationContInformationContInformationContinformationContinformation_cont 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 CumInformationContCumInformationContCumInformationContCumInformationContcumInformationContcum_information_cont zurückgegeben, d.h. CumInformationContCumInformationContCumInformationContCumInformationContcumInformationContcum_information_cont enthält die Summen der ersten n Elemente von InformationContInformationContInformationContInformationContinformationContinformation_cont. Um get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm verwenden zu können, müssen mit add_sample_class_gmmadd_sample_class_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmmadd_sample_class_gmm oder read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmmread_samples_class_gmm genügend viele Trainingsmuster zu dem durch GMMHandleGMMHandleGMMHandleGMMHandleGMMHandlegmmhandle gegebenen GMM hinzugefügt werden.

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

Ausführungsinformationen

Parameter

GMMHandleGMMHandleGMMHandleGMMHandleGMMHandlegmmhandle (input_control)  class_gmm HClassGmm, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des GMM.

PreprocessingPreprocessingPreprocessingPreprocessingpreprocessingpreprocessing (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (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"

InformationContInformationContInformationContInformationContinformationContinformation_cont (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Relativer Informationsgehalt der transformierten Merkmalsvektoren.

CumInformationContCumInformationContCumInformationContCumInformationContcumInformationContcum_information_cont (output_control)  real-array HTupleSequence[float]HTupleHtuple (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_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm den Wert 2 (H_MSG_TRUE). Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Falls get_prep_info_class_gmmget_prep_info_class_gmmGetPrepInfoClassGmmGetPrepInfoClassGmmGetPrepInfoClassGmmget_prep_info_class_gmm 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_gmmAddSampleClassGmmAddSampleClassGmmAddSampleClassGmmadd_sample_class_gmm, read_samples_class_gmmread_samples_class_gmmReadSamplesClassGmmReadSamplesClassGmmReadSamplesClassGmmread_samples_class_gmm

Nachfolger

clear_class_gmmclear_class_gmmClearClassGmmClearClassGmmClearClassGmmclear_class_gmm, create_class_gmmcreate_class_gmmCreateClassGmmCreateClassGmmCreateClassGmmcreate_class_gmm

Literatur

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

Modul

Foundation