Creating a custom metric for displaying training accuracy

i want to view the training accuracy in the progress bar along with valdation accuracy and the other loss values . I found out that the best way to go about it is to add a custom metric. But i can’t seem
to find a way to access the training predictions .how do i implement that in my custom metrics function. Any Insight on the topic is appreciated.