Based on this, what would be the most appropriate way to define my training model so that I could then record loss and accuracy?
The model definition is independent from recording the loss and accuracy so could you explain the issue a bit more, please?
PS: you can post code snippets by wrapping them into three backticks ```, which would make debugging easier.