Training acc 100%

First of all, I want to show you my projector. I think it looks right. It is the first time I see it. Just want to make sure that it seems right. would you please take a look please?

It seems that the words closer to “sport” is not so related.
Would that be something wrong with my code? although I get passed.
My model is like this:

[code removed - moderator]

I got training ACC 100%. It is overfitting I think. Would you please give me some suggestions?
Appreciate it.

Hello sir,
I do think that it is over fitting as training accuracy is far too high and I highly suspect that the model won’t do well on an unknown data.
Coming to the tensorboard visualization, I believe that words similar to each other should lie close to each other and I think it is because of the simplicity of your model. You may try adding some RNN’s LSTM’s to get a better visualization. As far as accuracy is concerned, I do not know why it is going this high and I think @balaji.ambresh sir you might be able to help us here.
Thanking you
Mayank Ghogale

Couple of things.

  1. Course 2 week 2 deals with an image based classification problem. Please move this post to the right topic.
  2. There’s no clue about what the problem is. So, it makes sense to describe the problem and how it’s tied to the accuracy.

It would also help if you clicked my name (add Mayank to this list) and shared your notebook as an attachment for me to get better insight into the problem.

I’ll take a stab at this without the above context for now.
It’s possible to get a training accuracy of 100% if the dataset is very easy to classify / the model is sufficiently trained. If the model gets 100% accuracy in the test set, then, there’s no reason for concern (assuming that training and test sets reflect true data distribution).

If training accuracy is much greater than test accuracy, then, you are overfitting the training dataset. Deep learning specialization courses 2 and 3 cover this topic in detail if you’re looking for more guidance.


Here are a few things to fix in your notebook:

  1. In function def fit_tokenizer(train_sentences, num_words, oov_token):, make use of the function parameter instead of hardcoding the oov token in the call to Tokenizer constructor.
  2. The learning rate for the optimizer is high. The default for RMSProp is 1e-3 and it seems to perform better than the one you’ve set.

When the grader sets thresholds for training / validation accuracies, it’s safe for your NN to be a bit higher than the thresold. With that in mind, try the following:

  1. Choice of optimizer / batch size / learning rate (start with the defaults).
  2. A different NN. Hint: Try adding one more dense layer before the last layer in your case.

Thank you Mentor. I think I get it. I also get C3W3 right on your advice. :partying_face: