Executing the Model 

Now its time to train our model with the provided dataset and the pre-trained embedding model. A few hyperparameters will need fine-tuning to achieve good results. But once we have executed the train.py file with reasonably good configurations we can demonstrate that the model is able to classify well between the positive and negative sentences.

As we can see in the image the performance metric of accuracy is tending towards 1 and the loss factor is reducing towards 0 over each iteration.

Figure 3.9 Plot of the performance metrics accuracy and loss of the CNN model during training process.

Voila! We just used the pre-trained embedding model to train our CNN classifier with the average loss of 6.9 and accuracy of 72.6%.

Once the model training is completed successfully, the output of the model will have :

  • The checkpoints stored in /runs/ folder. We will use this checkpoints to make predictions.
  • A summary with all the loss, accuracy, histogram and gradient value distribution captured during the training process. One can visualize it using the tensorboard.
..................Content has been hidden....................

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