Log experiment details in Tensorboard

I am running a model from a script that reads the parameters from a config file and start training the model afterwards. The config.py file contains information like this:

DENSE_ACTIVATION = ["relu", "relu", None]
DENSE_UNITS = [128, 64, 1] # These are units for three different dense layers
DROPOUT_RATES = [0.3, 0.5]
POOLING = "avg"
WEIGHTS = "imagenet"

LOSS_FN = {"binary_crossentropy": keras.losses.BinaryCrossentropy(from_logits=True)}
OPTIMIZER = {"adam": keras.optimizers.Adam(LEARNING_RATE)}
METRICS = {"accuracy": keras.metrics.BinaryAccuracy()}
    "early_stopping": keras.callbacks.EarlyStopping(
        patience=ES_PATIENCE, restore_best_weights=RESTORE_BEST_WEIGHTS

What I want to achieve:

  1. Read the user settings from this config file
  2. Log these values in tensorboard

Is there any simple way to do it? I am asking this because:

  1. This is a mix of logging custom scalars and other values(everything in the config)
  2. I cannot use the hparams API because I don’t want to annotate the model with something that the end user may not understand. Also, I don’t want to run multiple experiments at once because I want to debug my model performance before launching another experiment with another setting

Maybe something like this?

1 Like

Thanks @Kzyh Looks like this can work. I will give it a try and will update the post. Thanks again