handwriting-ocr icon indicating copy to clipboard operation
handwriting-ocr copied to clipboard

Suggest parameters for training word classifier CTC with IAM dataset

Open yasersakkaf opened this issue 6 years ago • 3 comments

Following are the default parameters used in the word_classifier_CTC notebook: char_size = 67 PAD = 0 # Padding

num_new_images = 2 # Number of new images per image fac_alpha = 2.0 # Factors for image preprocessing fac_sigma = 0.08

num_buckets = 10 slider_size = (60, 2) step_size = 2 N_INPUT = slider_size[0]*slider_size[1] vocab_size = char_size + 2 # Number of different chars + <PAD> and <EOS>

layers = 2 residual_layers = 1 # HAVE TO be smaller than layers units = 256 num_hidden = 2*units

learning_rate = 1e-4 # 1e-4 max_gradient_norm = 5.0 # For gradient clipping dropout = 0.4 train_per = 0.8 # Percentage of training data

TRAIN_STEPS = 100000 # Number of training steps! TEST_ITER = 150 LOSS_ITER = 50 SAVE_ITER = 2000 BATCH_SIZE = 20 EPOCH = 2000 # Number of batches in epoch - not accurate

We used the same parameters for training the word classifier CTC mdel with IAM dataset and it took 7 hours for 1 Epoch on GPU. Please suggest what should be the parameters for training the word classifier CTC mdel with IAM dataset so that the training gets completed in less time.

yasersakkaf avatar Feb 07 '19 07:02 yasersakkaf

Hi, I am sorry the CTC notebook right now is quite slow. I already have quicker version (it's not fully tested), but I will update it here during today and let you know. What do you prefer python script or jupyter notebook (currently I prefer python scripts)?

Breta01 avatar Feb 07 '19 08:02 Breta01

I just updated the code. Please try it out. If you encounter any errors let me know.

Breta01 avatar Feb 07 '19 21:02 Breta01

Thanks. I will try it out.

yasersakkaf avatar Feb 15 '19 05:02 yasersakkaf