code: def __init__(
      self,
      estimators: List[DeepAREstimator],
      prediction_length: int,
      temporal_hierarchy: utils.TemporalHierarchy,
      do_reconciliation: bool,
      dtype: Type,
      use_gnn: bool,
      use_mlp: bool,
      adj_mat_option: str,
      non_negative: bool = False,
      naive_reconciliation: bool = False,
      prediction: bool = False,
      loss_function: str = "crps_univariate",
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
  
      self.prediction_length = prediction_length
      self.temporal_hierarchy = temporal_hierarchy
      self.use_gnn = use_gnn
      self.use_mlp = use_mlp
      self.adj_mat_option = adj_mat_option
      self.do_reconciliation = do_reconciliation
      self.non_negative = non_negative
      self.loss_function = loss_function
      self.dtype = dtype
  
      if naive_reconciliation:
          M = utils.naive_reconcilation_mat(
              self.temporal_hierarchy.agg_mat,
              self.temporal_hierarchy.nodes,
          )
      else:
          M = projection_mat(S=self.temporal_hierarchy.agg_mat)
      self.M = mx.nd.array(M)
  
      self.estimators = estimators
  
      self.models = []
      with self.name_scope():
          for estimator in estimators:
              if not prediction:
                  self.network = estimator.create_training_network()
              else:
                  self.network = (
                      gluonts_fixes.create_prediction_network(estimator)
                  )
  
              self.register_child(self.network)
              self.models.append(self.network)
  
          if self.use_gnn:
              # GNN Layer: Do message passing for `L-1` times, where `L` is the number of levels of the hierarchy.
              self.gnn = gnn.GNN(
                  units=self.estimators[0].num_cells,
                  num_layers=len(self.temporal_hierarchy.agg_multiples)
                  - 1,
                  adj_matrix=mx.nd.array(
                      self.temporal_hierarchy.adj_mat(
                          option=self.adj_mat_option
                      )
                  ),
                  use_mlp=self.use_mlp,
              )
  
imports: from typing import Dict, List, Optional, Tuple
  import mxnet
  import numpy
  from gluonts.core.component import Type, validated
  from gluonts.itertools import prod
  from gluonts.mx.model.deepar import DeepAREstimator
  from gluonts.mx.model.deepar._network import DeepARPredictionNetwork
  from gluonts.mx.model.deepvar_hierarchical._estimator import projection_mat
  from gluonts.mx.model.deepvar_hierarchical._network import coherency_error
  from gluonts.mx.distribution import Distribution, EmpiricalDistribution
  from gluonts.mx import Tensor
  from gluonts.mx.distribution import TransformedPiecewiseLinear
  from gluonts.nursery.temporal_hierarchical_forecasting.utils import utils
  from gluonts.nursery.temporal_hierarchical_forecasting.model.cop_deepar import gluonts_fixes, gnn
label_desc: Use image node_id 1 to create a new COPNetwork object from inherited base classes: mx.gluon with example: obj = COPNetwork(estimators, prediction_length, temporal_hierarchy, do_reconciliation, dtype, use_gnn, use_mlp, adj_mat_option, non_negative, naive_reconciliation, prediction, loss_function)