code: def kl_div_coef(c: Configs):
      """
      ### KL Divergence Loss Coefficient Schedule
      """
  
      # Create a [relative piecewise schedule](https://docs.labml.ai/api/helpers.html#labml_helpers.schedule.Piecewise)
      return RelativePiecewise(
          c.kl_div_coef_schedule, c.epochs * len(c.train_dataset)
      )
  
imports: from typing import Any
  import torch.nn
  import torch.utils.data
  from labml import tracker, experiment
  from labml.configs import option, calculate
  from labml_helpers.module import Module
  from labml_helpers.schedule import Schedule, RelativePiecewise
  from labml_helpers.train_valid import BatchIndex
  from labml_nn.experiments.mnist import MNISTConfigs
  from labml_nn.uncertainty.evidence import KLDivergenceLoss, TrackStatistics, MaximumLikelihoodLoss, CrossEntropyBayesRisk, SquaredErrorBayesRisk
label_desc: Use image node_id 2 for calling a global function with example usage: kl_div_coef(c) and returns: RelativePiecewise