trainf_ocr_class_mlp_protectedT_trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected (Operator)

Name

trainf_ocr_class_mlp_protectedT_trainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected — Trainieren eines OCR-Klassifikators mit Daten aus (geschützten) Trainingsdateien.

Signatur

trainf_ocr_class_mlp_protected( : : OCRHandle, TrainingFile, Password, MaxIterations, WeightTolerance, ErrorTolerance : Error, ErrorLog)

Herror T_trainf_ocr_class_mlp_protected(const Htuple OCRHandle, const Htuple TrainingFile, const Htuple Password, const Htuple MaxIterations, const Htuple WeightTolerance, const Htuple ErrorTolerance, Htuple* Error, Htuple* ErrorLog)

void TrainfOcrClassMlpProtected(const HTuple& OCRHandle, const HTuple& TrainingFile, const HTuple& Password, const HTuple& MaxIterations, const HTuple& WeightTolerance, const HTuple& ErrorTolerance, HTuple* Error, HTuple* ErrorLog)

double HOCRMlp::TrainfOcrClassMlpProtected(const HTuple& TrainingFile, const HTuple& Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

double HOCRMlp::TrainfOcrClassMlpProtected(const HString& TrainingFile, const HString& Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

double HOCRMlp::TrainfOcrClassMlpProtected(const char* TrainingFile, const char* Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const

double HOCRMlp::TrainfOcrClassMlpProtected(const wchar_t* TrainingFile, const wchar_t* Password, Hlong MaxIterations, double WeightTolerance, double ErrorTolerance, HTuple* ErrorLog) const   (Nur Windows)

static void HOperatorSet.TrainfOcrClassMlpProtected(HTuple OCRHandle, HTuple trainingFile, HTuple password, HTuple maxIterations, HTuple weightTolerance, HTuple errorTolerance, out HTuple error, out HTuple errorLog)

double HOCRMlp.TrainfOcrClassMlpProtected(HTuple trainingFile, HTuple password, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)

double HOCRMlp.TrainfOcrClassMlpProtected(string trainingFile, string password, int maxIterations, double weightTolerance, double errorTolerance, out HTuple errorLog)

def trainf_ocr_class_mlp_protected(ocrhandle: HHandle, training_file: MaybeSequence[str], password: MaybeSequence[str], max_iterations: int, weight_tolerance: float, error_tolerance: float) -> Tuple[float, Sequence[float]]

Beschreibung

trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected trainiert den OCR-Klassifikator OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle mit den Trainingsdaten, die in den durch TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file angegebenen OCR-Trainingsdateien enthalten sind. Die Funktionalität des Operators entspricht der Funktionalität von trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp, mit der Erweiterung, dass trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected sowohl ungeschützte als auch geschützte Trainingsdateien verarbeiten kann. Geschützte Trainingsdateien können nur mit dem korrekten Benutzerpasswort PasswordPasswordPasswordPasswordpasswordpassword verwendet werden. Falls genau ein Passwort PasswordPasswordPasswordPasswordpasswordpassword übergeben wird, werden alle Eingabedateien TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file mit diesem Passwort überprüft, ansonsten muss die Anzahl der Passworte gleich der Anzahl der Eingabedateien sein, und die Eingabedatei an Position n wird mit dem Passwort an Position n überprüft. Für ungeschützte Trainingsdateien werden die übergebenen Passworte ignoriert.

Für eine genauere Beschreibung der Operatorfunktionalität siehe trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp. Das Konzept des Schützens von OCR-Trainingsdaten in HALCON ist in protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf beschrieben.

Ausführungsinformationen

Dieser Operator modifiziert den Zustand des folgenden Eingabeparameters:

Während der Ausführung dieses Operators muss der Zugriff auf den Wert dieses Parameters synchronisiert werden, wenn er über mehrere Threads hinweg verwendet wird.

Parameter

OCRHandleOCRHandleOCRHandleOCRHandleOCRHandleocrhandle (input_control, Zustand wird modifiziert)  ocr_mlp HOCRMlp, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle des OCR-Klassifikators.

TrainingFileTrainingFileTrainingFileTrainingFiletrainingFiletraining_file (input_control)  filename.read(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Namen der Trainingsdateien.

Defaultwert: 'ocr.trf' "ocr.trf" "ocr.trf" "ocr.trf" "ocr.trf" "ocr.trf"

Dateiendung: .trf, .otr

PasswordPasswordPasswordPasswordpasswordpassword (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Passworte für geschützte Trainingsdateien.

MaxIterationsMaxIterationsMaxIterationsMaxIterationsmaxIterationsmax_iterations (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximale Anzahl von Iterationen des Optimierungsverfahrens.

Defaultwert: 200

Wertevorschläge: 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300

WeightToleranceWeightToleranceWeightToleranceWeightToleranceweightToleranceweight_tolerance (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Schwellenwert für den Unterschied der Gewichte des MLP zwischen zwei Iterationen des Optimierungsverfahrens.

Defaultwert: 1.0

Wertevorschläge: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001

Restriktion: WeightTolerance >= 1.0e-8

ErrorToleranceErrorToleranceErrorToleranceErrorToleranceerrorToleranceerror_tolerance (input_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Schwellenwert für den Unterschied des mittleren Fehlers des MLP auf den Trainingsdaten zwischen zwei Iterationen des Optimierungsverfahrens.

Defaultwert: 0.01

Wertevorschläge: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001

Restriktion: ErrorTolerance >= 1.0e-8

ErrorErrorErrorErrorerrorerror (output_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Mittlerer Fehler des MLP auf den Trainingsdaten.

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

Mittlerer Fehler des MLP auf den Trainingsdaten pro Iteration des Optimierungsverfahrens.

Ergebnis

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

Falls trainf_ocr_class_mlp_protectedtrainf_ocr_class_mlp_protectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedTrainfOcrClassMlpProtectedtrainf_ocr_class_mlp_protected 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. Für diesen Fall ist es sinnvoll, PreprocessingPreprocessingPreprocessingPreprocessingpreprocessingpreprocessing auf 'normalization'"normalization""normalization""normalization""normalization""normalization" zu setzen. Ansonsten ist es auch möglich, mehr Trainingsmuster hinzuzufügen.

Vorgänger

create_ocr_class_mlpcreate_ocr_class_mlpCreateOcrClassMlpCreateOcrClassMlpCreateOcrClassMlpcreate_ocr_class_mlp, write_ocr_trainfwrite_ocr_trainfWriteOcrTrainfWriteOcrTrainfWriteOcrTrainfwrite_ocr_trainf, append_ocr_trainfappend_ocr_trainfAppendOcrTrainfAppendOcrTrainfAppendOcrTrainfappend_ocr_trainf, write_ocr_trainf_imagewrite_ocr_trainf_imageWriteOcrTrainfImageWriteOcrTrainfImageWriteOcrTrainfImagewrite_ocr_trainf_image, protect_ocr_trainfprotect_ocr_trainfProtectOcrTrainfProtectOcrTrainfProtectOcrTrainfprotect_ocr_trainf

Nachfolger

do_ocr_single_class_mlpdo_ocr_single_class_mlpDoOcrSingleClassMlpDoOcrSingleClassMlpDoOcrSingleClassMlpdo_ocr_single_class_mlp, do_ocr_multi_class_mlpdo_ocr_multi_class_mlpDoOcrMultiClassMlpDoOcrMultiClassMlpDoOcrMultiClassMlpdo_ocr_multi_class_mlp, write_ocr_class_mlpwrite_ocr_class_mlpWriteOcrClassMlpWriteOcrClassMlpWriteOcrClassMlpwrite_ocr_class_mlp

Alternativen

read_ocr_class_mlpread_ocr_class_mlpReadOcrClassMlpReadOcrClassMlpReadOcrClassMlpread_ocr_class_mlp

Siehe auch

trainf_ocr_class_mlptrainf_ocr_class_mlpTrainfOcrClassMlpTrainfOcrClassMlpTrainfOcrClassMlptrainf_ocr_class_mlp, train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlptrain_class_mlp

Modul

OCR/OCV