class_docstr: Base Task superclass used to implement new tasks.
  
  Attributes:
      model: Model name string for the task in use.
      local: Run locally. Defaults to False.
      api_key: Backprop API key for non-local inference.
      device: Device to run inference on. Defaults to "cuda" if available.
      models: All supported models for a given task (pulls from config).
      default_local_model: Which model the task will default to if initialized with none provided: Defined per-task.
class_docstr_tok: ["Base","Task","superclass","used","to","implement","new","tasks",".","Attributes",":","model",":","Model","name","string","for","the","task","in","use",".","local",":","Run","locally",".","Defaults","to","False",".","api_key",":","Backprop","API","key","for","non-local","inference",".","device",":","Device","to","run","inference","on",".","Defaults","to","``","cuda","''","if","available",".","models",":","All","supported","models","for","a","given","task","(","pulls","from","config",")",".","default_local_model",":","Which","model","the","task","will","default","to","if","initialized","with","none","provided",":","Defined","per-task","."]
docstr: Performs the step function with validation data and gets validation loss.
  
  Args:
      batch: Batch output from dataloader.
      batch_idx: Batch index.
docstr_tok: ["Performs","the","step","function","with","validation","data","and","gets","validation","loss",".","Args",":","batch",":","Batch","output","from","dataloader",".","batch_idx",":","Batch","index","."]
code: def validation_step(self, batch, batch_idx):
      """
      Performs the step function with validation data and gets validation loss.
  
      Args:
          batch: Batch output from dataloader.
          batch_idx: Batch index.
      """
      loss = self.step(batch, batch_idx)
  
      self.log(
          "val_loss", loss, prog_bar=True, on_epoch=True, logger=True
      )
      return loss
  
imports: from typing import Dict, List, Union, Tuple
  import logging
  import backprop
  from backprop.models import AutoModel
  import pytorch_lightning
  from torch.utils.data.dataloader import DataLoader
  import os
  import torch
  from torch.utils.data import Subset, Dataset
  from pytorch_lightning.utilities.memory import garbage_collection_cuda
  from pytorch_lightning.callbacks import EarlyStopping
label_desc: Use image node_id 7 for calling the Task obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) and returns: loss