Hey, thank you for your response,
i am also calculating perplexity using the same code and i am using perplexity as a metric rather than accuracy.
This is because i don’t thing accuracy would be a better choice(as a metric) for mlm because there can be may words which can be used for a given mask. (feel free the correct) , instead i am calculating perplexity in the compute metric function and printing it along with training_loss and validation loss along in the logs.
Thanks again!!