17.4.8 Getting the Training Log for an Unsupervised GraphWise Model

If you configured a validation step (see Training an Unsupervised GraphWise Model) earlier, then you can fetch the training log that contains the training and validation loss information.

opg4j> var trainingLog = model.getTrainingLog()
PgxFrame trainingLog = model.getTrainingLog();
training_log = model.get_training_log()

The output frame will be similar to the following example output:

+--------------------------------------------------+
| step  | training_loss      | validation_loss     |
+--------------------------------------------------+
| 100   | 1.5059218406677246 | 0.41696539521217346 |
| 200   | 0.5052874088287354 | 0.3255307078361511  |
| 300   | 0.3264007568359375 | 0.44015955924987793 |
+--------------------------------------------------+
Also, note the following:
  • The first column will be named according to the evaluation frequency scale that was set in the validation configuration ("epoch" or "step").
  • The validation loss is the average of the losses evaluated on all batches of the validation graph, while the training loss is the loss value logged at that epoch or step (that is, the loss evaluated on the last batch).
  • The training log will be overwritten if the fit method is called multiple times.