Hello,
I am not usre if I understand you, but it seems for me that the code is working as expected, it logs every 100 batches.
Maybe your question is why the loss is not decreasing, if that’s your question, I think you maybe should change the learning rate or check if the used architecture is correct. Also seems that you are trying to build a text retrieval system. Check if your batches are drawn correctly.