Thank you guys for the help,
I did implement it as recommended by @Caruso and @pchandrasekaran
it seems to have initiated the training but… Its not training as expected. as the training accuracy increases, so does the loss. doesn’t make sense.
The link to code: (Please note some class names might be different)
Link to my GitHub 4