Hyperparameters

We can try a few more parameters to check whether additional parameters will help to improve results.

Specify them in the form that's given in the following bullet points. The hyperparameters are explained as follows:

  • --learning_rate: This parameter controls the updates to the final layer while training. If this value is small, the training will take more time. This may not always help when it comes to improving accuracy.
  • --train_batch_size: This parameter helps with controlling the number of images that are examined during training to estimate the final-layer updates. Once the images are ready, the script splits them into three different sets. The largest set is used in training. This division is mainly useful for preventing the model from recognizing unnecessary patterns in the input images. If a model is trained using a certain background pattern, it won't give a proper result when it faces images with new backgrounds because it remembers unnecessary information from the input images. This is known as overfitting.
  • --testing_percentage and --validation_percentage flags: To avoid overfitting, we keep 80% of the data inside the main training set. Of this data, 10% is then used to run validation during the training process and the final 10% is used to test the model.

  • --validation_batch_size: We can see that the accuracy of validation fluctuates between iterations. 

If you are new to this, you can run default values without making any changes to these parameters. Let's jump into building our model. For this, we need the training image data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset