January 2019
Intermediate to advanced
342 pages
9h 17m
English
The CAPTCHA breaker model can be trained by invoking the train function as follows:
def train(dest_train,dest_val,outdir,batch_size,n_classes,dim,shuffle,epochs,lr): char_to_index_dict,index_to_char_dict = create_dict_char_to_index() model = _model_(n_classes) train_generator = DataGenerator(dest_train,char_to_index_dict,batch_size,n_classes,dim,shuffle) val_generator = DataGenerator(dest_val,char_to_index_dict,batch_size,n_classes,dim,shuffle) model.fit_generator(train_generator,epochs=epochs,validation_data=val_generator) model.save(outdir + 'captcha_breaker.h5')
For the CAPTCHAs in the batch, all four characters are considered for training. We define the train_generator and val_generator object using the ...
Read now
Unlock full access