Objective: employ model subclassing and custom training loops in Tensorflow to train a model for the Reuters dataset.
Reuters is a benchmark dataset for document classification. It is a multiclass dataset, with 46 posible classes for each of the text fragments.
A similar code employing the Sequential API of Tensorflow can be foung in Kaggle: https://www.kaggle.com/drscarlat/reuters-document-classification-with-keras-tf