original_docstring: 
          Compute representation of node labels using a 2-layer character CNN.
  
          Args:
              unique_labels_as_characters: int32 tensor of shape [U, C]
                  representing the unique (node) labels occurring in a
                  batch, where U is the number of such labels and C the
                  maximal number of characters.
              node_labels_to_unique_labels: int32 tensor of shape [V],
                  mapping each node in the batch to one of the unique
                  labels.
  
          Returns:
              float32 tensor of shape [V, D] representing embedded node
              label information about each node.
          
docstring: Compute representation of node labels using a 2-layer character CNN.
docstring_tokens: Compute representation of node labels using a 2 - layer character CNN .
code: def __get_node_label_charcnn_embeddings(self,
                                              unique_labels_as_characters: tf.Tensor,
                                              node_labels_to_unique_labels: tf.Tensor,
                                              ) -> tf.Tensor:
          """
          Compute representation of node labels using a 2-layer character CNN.
  
          Args:
              unique_labels_as_characters: int32 tensor of shape [U, C]
                  representing the unique (node) labels occurring in a
                  batch, where U is the number of such labels and C the
                  maximal number of characters.
              node_labels_to_unique_labels: int32 tensor of shape [V],
                  mapping each node in the batch to one of the unique
                  labels.
  
          Returns:
              float32 tensor of shape [V, D] representing embedded node
              label information about each node.
          """
          label_embedding_size = self.params['graph_node_label_representation_size']  # D
          # U ~ num unique labels
          # C ~ num characters (self.params['graph_node_label_max_num_chars'])
          # A ~ num characters in alphabet
          # TODO: noamcode: add label_one_hot input as a field
          self.unique_label_chars_one_hot = \
              unique_label_chars_one_hot = tf.one_hot(indices=unique_labels_as_characters,
                                                  depth=len(ALPHABET),
                                                  axis=-1)  # Shape: [U, C, A]
  
          # Choose kernel sizes such that there is a single value at the end:
          char_conv_l1_kernel_size = 5
          char_conv_l2_kernel_size = \
              self.params['graph_node_label_max_num_chars'] - 2 * (char_conv_l1_kernel_size - 1)
  
          char_conv_l1 = \
              tf.keras.layers.Conv1D(filters=16,
                                     kernel_size=char_conv_l1_kernel_size,
                                     activation=tf.nn.leaky_relu,
                                     )(unique_label_chars_one_hot)  # Shape: [U, C - (char_conv_l1_kernel_size - 1), 16]
          char_pool_l1 = \
              tf.keras.layers.MaxPool1D(pool_size=char_conv_l1_kernel_size,
                                        strides=1,
                                        )(inputs=char_conv_l1)      # Shape: [U, C - 2*(char_conv_l1_kernel_size - 1), 16]
          char_conv_l2 = \
              tf.keras.layers.Conv1D(filters=label_embedding_size,
                                     kernel_size=char_conv_l2_kernel_size,
                                     activation=tf.nn.leaky_relu,
                                     )(char_pool_l1)                # Shape: [U, 1, D]
          unique_label_representations = tf.squeeze(char_conv_l2, axis=1)  # Shape: [U, D]
          # TODO: maybe gradient to this: tf.gather
          # multiply by: unique_label_representations
          # and replace the desired var in node_labels_to_unique_labels (on true data)
          node_label_representations = tf.gather(params=unique_label_representations,
                                                 indices=node_labels_to_unique_labels)
          return node_label_representations
code_tokens: def __get_node_label_charcnn_embeddings ( self , unique_labels_as_characters : tf . Tensor , node_labels_to_unique_labels : tf . Tensor , ) -> tf . Tensor : label_embedding_size = self . params [ 'graph_node_label_representation_size' ] self . unique_label_chars_one_hot = unique_label_chars_one_hot = tf . one_hot ( indices = unique_labels_as_characters , depth = len ( ALPHABET ) , axis = - 1 ) char_conv_l1_kernel_size = 5 char_conv_l2_kernel_size = self . params [ 'graph_node_label_max_num_chars' ] - 2 * ( char_conv_l1_kernel_size - 1 ) char_conv_l1 = tf . keras . layers . Conv1D ( filters = 16 , kernel_size = char_conv_l1_kernel_size , activation = tf . nn . leaky_relu , ) ( unique_label_chars_one_hot ) char_pool_l1 = tf . keras . layers . MaxPool1D ( pool_size = char_conv_l1_kernel_size , strides = 1 , ) ( inputs = char_conv_l1 ) char_conv_l2 = tf . keras . layers . Conv1D ( filters = label_embedding_size , kernel_size = char_conv_l2_kernel_size , activation = tf . nn . leaky_relu , ) ( char_pool_l1 ) unique_label_representations = tf . squeeze ( char_conv_l2 , axis = 1 ) node_label_representations = tf . gather ( params = unique_label_representations , indices = node_labels_to_unique_labels ) return node_label_representations
short_docstring: Compute representation of node labels using a 2-layer character CNN.
short_docstring_tokens: Compute representation of node labels using a 2 - layer character CNN .
comment: """
          Compute representation of node labels using a 2-layer character CNN.
  
          Args:
              unique_labels_as_characters: int32 tensor of shape [U, C]
                  representing the unique (node) labels occurring in a
                  batch, where U is the number of such labels and C the
                  maximal number of characters.
              node_labels_to_unique_labels: int32 tensor of shape [V],
                  mapping each node in the batch to one of the unique
                  labels.
  
          Returns:
              float32 tensor of shape [V, D] representing embedded node
              label information about each node.
          """$SEP$# D$SEP$# U ~ num unique labels$SEP$# C ~ num characters (self.params['graph_node_label_max_num_chars'])$SEP$# A ~ num characters in alphabet$SEP$# TODO: noamcode: add label_one_hot input as a field$SEP$# Shape: [U, C, A]$SEP$# Choose kernel sizes such that there is a single value at the end:$SEP$# Shape: [U, C - (char_conv_l1_kernel_size - 1), 16]$SEP$# Shape: [U, C - 2*(char_conv_l1_kernel_size - 1), 16]$SEP$# Shape: [U, 1, D]$SEP$# Shape: [U, D]$SEP$# TODO: maybe gradient to this: tf.gather$SEP$# multiply by: unique_label_representations$SEP$# and replace the desired var in node_labels_to_unique_labels (on true data)