title: Tensorflow Keras Keep Loss of Every Batch
body: <p>I looking for advice/examples for the best practice in constructing my keras model architecture.</p>
  <p>I've been fumbling with various iterations of the Model() subclass and the Functional model but have not been able to connect all the dots.</p>
  <p>The model should have Custom Metrics and associated loss where-by: During training, metrics are calculated per batch and at the end of each epoch final metrics/loss are calculated from the mean of the batch calculations.</p>
  <p>To my thinking I would need a <code>Custom_Batch_Metric()</code> that would maintain a list of the metrics for each batch, in addition to a <code>Custom_Final_Metric()</code> that would average the results from each batch.  I'm not sure how to implement this.</p>
  <p>For example... Per batch I would like to generate a <code>metric</code> and <code>loss</code> for the correlation of y_true, y_pred.  At the end of my epoch I would like to then average (or find the max) of the batch correlations.</p>
  <p>Would very much appreciate any reading someone could point me to regarding this sort of architecture.</p>