davidfox87 / eks-terraform-tfjob-katib-argo

3 stars 0 forks source link

Custom logging for Katib #10

Open davidfox87 opened 1 year ago

davidfox87 commented 1 year ago

Callback class for logging training.

# Katib parses metrics in this format: <metric-name>=<metric-value>.
class CustomCallback(tf.keras.callbacks.Callback):
    def on_epoch_end(self, epoch, logs=None):
        logging.info(
            "Epoch {}/{}. accuracy={:.4f} - loss={:.4f}".format(
                epoch+1, num_epoch, logs["accuracy"], logs["loss"]
            )
        )
davidfox87 commented 1 year ago

logging.basicConfig( format="%(asctime)s %(levelname)-8s %(message)s", datefmt="%Y-%m-%dT%H:%M:%SZ", level=logging.INFO, )