def validation_step(self, batch, running_data):
    self.model.eval()
    n = batch['distance_fields'].shape[0]
    count = running_data['count']
    fwd_data = self.forward(batch)
    losses_dict = self._compute_lossses(batch, fwd_data)
    loss = losses_dict['loss']
    surfaceloss = losses_dict['surfaceloss']
    alignmentloss = losses_dict['alignmentloss']
    return {'loss': (((running_data['loss'] * count) + (loss.item() * n)) / (count + n)), 'surfaceloss': (((running_data['surfaceloss'] * count) + (surfaceloss.item() * n)) / (count + n)), 'alignmentloss': (((running_data['alignmentloss'] * count) + (alignmentloss.item() * n)) / (count + n)), 'count': (count + n)}
def validation_step(self, batch, running_data):
    self.model.eval()
    n = batch['distance_fields'].shape[0]
    count = running_data['count']
    fwd_data = self.forward(batch)
    losses_dict = self._compute_lossses(batch, fwd_data)
    loss = losses_dict['loss']
    surfaceloss = losses_dict['surfaceloss']
    alignmentloss = losses_dict['alignmentloss']
    return {'loss': (((running_data['loss'] * count) + (loss.item() * n)) / (count + n)), 'surfaceloss': (((running_data['surfaceloss'] * count) + (surfaceloss.item() * n)) / (count + n)), 'alignmentloss': (((running_data['alignmentloss'] * count) + (alignmentloss.item() * n)) / (count + n)), 'count': (count + n)}