I need to collect the targets and outputs vectors from my model after each batch using TensorFlow V2 and Keras 2.3.0. A similar question was previsously answered, but is valid only for TensorFlow V1. Did someone have an idea on how to proceed?
As I am using a batch_size
of 1 file (this is very specific to my case), my initial idea was to define a metric that would return the target/ouput label (i.e. an integer), and collect it in a callback at each batch end. Unfortunately, this metric is processed as any other metrics an averaged after each batch. I cannot find a way to simply return the un-averaged value, or even better to fetch it in a 1D array.