class_docstr: A distributed trainer for `AbstractComponent`s. Used mainly for supervised learning.
  
  Create a `DistributedModelTrainer` by passing a `AbstractNeuralModel` in the constructor.
  Invoke `train()` to initiate the training loop. The root `TNeuralModule` should return a scalar loss.
code: def train(
      self,
      training_data: Iterable[TRawDatapoint],
      validation_data: Iterable[TRawDatapoint],
      *,
      show_progress_bar: bool = True,
      validate_on_start: bool = True,
      patience: int = 5,
      initialize_metadata: bool = True,
      parallelize: bool = True,
      use_multiprocessing: bool = True,
      exponential_running_average_factor: float = 0.97,
      device=None,
      store_tensorized_data_in_memory: bool = False,
      shuffle_training_data: bool = True,
      start_epoch_idx: int = 0,
  ) -> None:
      raise Exception(
          "Use `distributed_train()` instead of calling `train()."
      )
  
imports: from typing_extensions import Final
  import json
  import logging
  import math
  import os
  import time
  import torch
  import torch.distributed
  import torch.multiprocessing
  from functools import partial
  from torch.nn.parallel import DistributedDataParallel
  from typing import Callable, Iterable, Optional, TypeVar
  from ptgnn.baseneuralmodel import ModelTrainer
  from ptgnn.baseneuralmodel.abstractneuralmodel import AbstractNeuralModel
  from ptgnn.baseneuralmodel.modulewithmetrics import ModuleWithMetrics
  from ptgnn.baseneuralmodel.utils.data import ShardedLazyDataIterable
label_desc: Use image node_id 3 for calling the DistributedModelTrainer obj's underlying member method code with example usage: obj.train(training_data, validation_data) without return types