class_docstr: Keras callback for logging metrics and final model with MLflow.
  
  Metrics are logged after every epoch. The logger keeps track of the best model based on the
  validation metric. At the end of the training, the best model is logged with MLflow.
class_docstr_tok: ["Keras","callback","for","logging","metrics","and","final","model","with","MLflow",".","Metrics","are","logged","after","every","epoch",".","The","logger","keeps","track","of","the","best","model","based","on","the","validation","metric",".","At","the","end","of","the","training",",","the","best","model","is","logged","with","MLflow","."]
code: def __init__(
      self, model, x_train, y_train, x_valid, y_valid, **kwargs
  ):
      self._model = model
      self._best_val_loss = math.inf
      self._train = (x_train, y_train)
      self._valid = (x_valid, y_valid)
      self._pyfunc_params = kwargs
      self._best_weights = None
  
imports: import math
  import os
  import tarfile
  import click
  import keras
  import numpy
  import tensorflow
  from image_pyfunc import decode_and_resize_image, log_model
  from keras.applications import vgg16
  from keras.callbacks import Callback
  from keras.layers import Dense, Flatten, Input, Lambda
  from keras.models import Model
  from keras.utils import np_utils
  from sklearn.model_selection import train_test_split
  import mlflow
  from mlflow.models import infer_signature
label_desc: Use image node_id 1 to create a new MLflowLogger object from inherited base classes: Callback with example: obj = MLflowLogger(model, x_train, y_train, x_valid, y_valid)