code: def on_batch_end(self, batch, logs):
      self.per_batch_losses.append(logs.get("loss"))
  
imports: import torch
  import tensorflow
  import os
  import numpy
  import keras
  from keras import layers
  from keras import ops
label_desc: Use image node_id 2 for calling the LossHistory obj's underlying member method code with example usage: obj.on_batch_end(batch, logs) without return types