trainf_ocr_class_mlp ( : : OCRHandle, TrainingFile, MaxIterations, WeightTolerance, ErrorTolerance : Error, ErrorLog )

Train an OCR classifier.

trainf_ocr_class_mlp trains the OCR classifier OCRHandle with the training characters stored in the OCR training files given by TrainingFile. The training files must been created, e.g., using write_ocr_trainf, before calling trainf_ocr_class_mlp. The remaining parameters have the same meaning as in train_class_mlp and are described in detail with train_class_mlp.


Parameters

OCRHandle (input_control)
ocr_mlp -> integer
Handle of the OCR classifier.

TrainingFile (input_control)
filename(-array) -> string
Name(s) of the training file(s).
Default value: ''ocr.trf''

MaxIterations (input_control)
integer -> integer
Maximum number of iterations of the optimization algorithm.
Default value: 200
Suggested values: 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300

WeightTolerance (input_control)
real -> real
Threshold for the difference of the weights of the MLP between two iterations of the optimization algorithm.
Default value: 1.0
Suggested values: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001
Restriction: WeightTolerance >= 1.0e-8

ErrorTolerance (input_control)
real -> real
Threshold for the difference of the mean error of the MLP on the training data between two iterations of the optimization algorithm.
Default value: 0.01
Suggested values: 1.0, 0.1, 0.01, 0.001, 0.0001, 0.00001
Restriction: ErrorTolerance >= 1.0e-8

Error (output_control)
real -> real
Mean error of the MLP on the training data.

ErrorLog (output_control)
real-array -> real
Mean error of the MLP on the training data as a function of the number of iterations of the optimization algorithm.


Example
* Train an OCR classifier
read_ocr_trainf_names ('ocr.trf', CharacterNames, CharacterCount)
create_ocr_class_mlp (8, 10, 'constant', 'default', CharacterNames, 80,
                      'none', 81, 42, OCRHandle)
trainf_ocr_class_mlp (OCRHandle, 'ocr.trf', 100, 1, 0.01, Error, ErrorLog)
write_ocr_class_mlp (OCRHandle, 'ocr.fnt')
clear_ocr_class_mlp (OCRHandle)

Result

If the parameters are valid, the operator trainf_ocr_class_mlp returns the value 2 (H_MSG_TRUE). If necessary an exception handling is raised.

trainf_ocr_class_mlp may return the error 9211 (Matrix is not positive definite) if Preprocessing = 'canonical_variates' is used. This typically indicates that not enough training samples have been stored for each class.


Parallelization Information

trainf_ocr_class_mlp is processed completely exclusively without parallelization.


Possible Predecessors

create_ocr_class_mlp, write_ocr_trainf, append_ocr_trainf, write_ocr_trainf_image


Possible Successors

do_ocr_single_class_mlp, do_ocr_multi_class_mlp, write_ocr_class_mlp


Alternatives

read_ocr_class_mlp


See also

train_class_mlp


Module

OCR/OCV



Copyright © 1996-2008 MVTec Software GmbH