Dice_loss for validation set

I'm using NiftyNet to process MRI images. It seems that the main program has only two options:

  1. train, to update weights based on training set;
  2. inference, to predict.

I want to adjust my hyperparameters using validation set, is there any convenient way to calculate the dice_loss of the validation set? I know there's the dice_loss calculation function, but starting from there can be quite painful...

Any advice will be appreciated!