docstr: performs the validation step
docstr_tok: ["performs","the","validation","step"]
code: def validation_step(self, val_batch, batch_idx) -> torch.Tensor:
      """performs the validation step"""
      output = self._produce_train_output(val_batch[:-1])
      target = val_batch[-1]
      loss = self._compute_loss(output, target)
      self.log(
          "val_loss",
          loss,
          batch_size=val_batch[0].shape[0],
          prog_bar=True,
          sync_dist=True,
      )
      self._calculate_metrics(output, target, self.val_metrics)
      return loss
  
imports: from abc import ABC, abstractmethod
  from functools import wraps
  from typing import Any, Dict, Optional, Sequence, Tuple, Union
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from joblib import Parallel, delayed
  from darts.logging import get_logger, raise_if, raise_log
  from darts.models.components.layer_norm_variants import RINorm
  from darts.timeseries import TimeSeries
  from darts.utils.likelihood_models import Likelihood
  from darts.utils.timeseries_generation import _build_forecast_series
  from darts.utils.torch import MonteCarloDropout
label_desc: Use image node_id 5 for calling the PLForecastingModule obj's underlying member method code with example usage: obj.validation_step(val_batch, batch_idx) and returns: loss