class_docstr: A generic message-passing graph neural network with discrete edge types.
class_docstr_tok: ["A","generic","message-passing","graph","neural","network","with","discrete","edge","types","."]
docstr: :param message_passing_layers: A list of message passing layers.
  :param node_embedder: a `nn.Module` that converts node data into a vector representation
  :param introduce_backwards_edges: If `True` special backwards edges should be automatically created.
  :param add_self_edges: If `True` self-edges will be added. These edges connect the same node across
      multiple timesteps.
  :param edge_dropout_rate: remove random pct of edges
docstr_tok: [":","param","message_passing_layers",":","A","list","of","message","passing","layers",".",":","param","node_embedder",":","a","`","nn.Module","`","that","converts","node","data","into","a","vector","representation",":","param","introduce_backwards_edges",":","If","`","True","`","special","backwards","edges","should","be","automatically","created",".",":","param","add_self_edges",":","If","`","True","`","self-edges","will","be","added",".","These","edges","connect","the","same","node","across","multiple","timesteps",".",":","param","edge_dropout_rate",":","remove","random","pct","of","edges"]
code: def __init__(
      self,
      message_passing_layers: List[AbstractMessagePassingLayer],
      node_embedder: nn.Module,
      introduce_backwards_edges: bool,
      add_self_edges: bool,
      edge_dropout_rate: float = 0.0,
      edge_feature_embedder: Optional[nn.Module] = None,
  ):
      """
      :param message_passing_layers: A list of message passing layers.
      :param node_embedder: a `nn.Module` that converts node data into a vector representation
      :param introduce_backwards_edges: If `True` special backwards edges should be automatically created.
      :param add_self_edges: If `True` self-edges will be added. These edges connect the same node across
          multiple timesteps.
      :param edge_dropout_rate: remove random pct of edges
      """
      super().__init__()
      self.__message_passing_layers = nn.ModuleList(
          message_passing_layers
      )
      self.__node_embedder = node_embedder
      self.__introduce_backwards_edges = introduce_backwards_edges
      self.__add_self_edges = add_self_edges
      assert 0 <= edge_dropout_rate < 1
      self.__edge_dropout_rate = edge_dropout_rate
      self.__edge_feature_embedder = edge_feature_embedder
  
imports: from typing_extensions import Final
  import logging
  import numpy
  import torch
  from collections import defaultdict
  from torch import nn
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar, Union
  from ptgnn.baseneuralmodel import AbstractNeuralModel, ModuleWithMetrics
  from ptgnn.baseneuralmodel.utils.data import enforce_not_None
  from ptgnn.neuralmodels.gnn.messagepassing.abstractmessagepassing import AbstractMessagePassingLayer
  from ptgnn.neuralmodels.gnn.structs import GnnOutput, GraphData, TensorizedGraphData
label_desc: Use image node_id 1 to create a new GraphNeuralNetwork object from inherited base classes: ModuleWithMetrics with example: obj = GraphNeuralNetwork(message_passing_layers, node_embedder, introduce_backwards_edges, add__edges, edge_dropout_rate, edge_feature_embedder)