docstr: :param embedding_size: it is the maximum embedding size, the actual
         size will be `min(vocabulary_size, embedding_size)`
         for `dense` representations and exactly `vocabulary_size`
         for the `sparse` encoding, where `vocabulary_size` is
         the number of different strings appearing in the training set
         in the column the feature is named after (plus 1 for
         `<UNK>`).
  :type embedding_size: Integer
  :param embeddings_on_cpu: by default embeddings matrices are stored
         on GPU memory if a GPU is used, as it allows
         for faster access, but in some cases the embedding matrix
         may be really big and this parameter forces the placement
         of the embedding matrix in regular memory and the CPU is used
         to resolve them, slightly slowing down the process
         as a result of data transfer between CPU and GPU memory.
  :param dropout: determines if there should be a dropout layer before
         returning the encoder output.
  :type dropout: Boolean
docstr_tok: [":","param","embedding_size",":","it","is","the","maximum","embedding","size",",","the","actual","size","will","be","`","min","(","vocabulary_size",",","embedding_size",")","`","for","`","dense","`","representations","and","exactly","`","vocabulary_size","`","for","the","`","sparse","`","encoding",",","where","`","vocabulary_size","`","is","the","number","of","different","strings","appearing","in","the","training","set","in","the","column","the","feature","is","named","after","(","plus","1","for","`","<","UNK",">","`",")",".",":","type","embedding_size",":","Integer",":","param","embeddings_on_cpu",":","by","default","embeddings","matrices","are","stored","on","GPU","memory","if","a","GPU","is","used",",","as","it","allows","for","faster","access",",","but","in","some","cases","the","embedding","matrix","may","be","really","big","and","this","parameter","forces","the","placement","of","the","embedding","matrix","in","regular","memory","and","the","CPU","is","used","to","resolve","them",",","slightly","slowing","down","the","process","as","a","result","of","data","transfer","between","CPU","and","GPU","memory",".",":","param","dropout",":","determines","if","there","should","be","a","dropout","layer","before","returning","the","encoder","output",".",":","type","dropout",":","Boolean"]
code: def __init__(
      self,
      embedding_size: int = 10,
      embeddings_on_cpu: bool = False,
      fc_layers: Optional[List] = None,
      num_fc_layers: int = 0,
      output_size: int = 10,
      use_bias: bool = True,
      weights_initializer: str = "xavier_uniform",
      bias_initializer: str = "zeros",
      norm: str = None,
      norm_params: Dict = None,
      activation: str = "relu",
      dropout: float = 0,
      reduce_output: str = "sum",
      encoder_config=None,
      **kwargs,
  ):
      """
      :param embedding_size: it is the maximum embedding size, the actual
             size will be `min(vocabulary_size, embedding_size)`
             for `dense` representations and exactly `vocabulary_size`
             for the `sparse` encoding, where `vocabulary_size` is
             the number of different strings appearing in the training set
             in the column the feature is named after (plus 1 for
             `<UNK>`).
      :type embedding_size: Integer
      :param embeddings_on_cpu: by default embeddings matrices are stored
             on GPU memory if a GPU is used, as it allows
             for faster access, but in some cases the embedding matrix
             may be really big and this parameter forces the placement
             of the embedding matrix in regular memory and the CPU is used
             to resolve them, slightly slowing down the process
             as a result of data transfer between CPU and GPU memory.
      :param dropout: determines if there should be a dropout layer before
             returning the encoder output.
      :type dropout: Boolean
      """
      super().__init__()
      self.config = encoder_config
  
      logger.debug(f" {self.name}")
  
      self.embedding_size = embedding_size
      self.reduce_output = reduce_output
      self.reduce_sequence = SequenceReducer(reduce_mode=reduce_output)
  
      logger.debug("  mode Embed")
      self.embed_mode = Embed(
          [str(i) for i in range(3)],
          embedding_size,
          representation="dense",
          embeddings_trainable=True,
          pretrained_embeddings=None,
          force_embedding_size=True,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
  
      logger.debug("  edge Embed")
      self.embed_edge = Embed(
          [str(i) for i in range(7)],
          embedding_size,
          representation="dense",
          embeddings_trainable=True,
          pretrained_embeddings=None,
          force_embedding_size=True,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
  
      logger.debug("  resolution Embed")
      self.embed_resolution = Embed(
          [str(i) for i in range(16)],
          embedding_size,
          representation="dense",
          embeddings_trainable=True,
          pretrained_embeddings=None,
          force_embedding_size=True,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
  
      logger.debug("  base cell Embed")
      self.embed_base_cell = Embed(
          [str(i) for i in range(122)],
          embedding_size,
          representation="dense",
          embeddings_trainable=True,
          pretrained_embeddings=None,
          force_embedding_size=True,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
  
      logger.debug("  cells Embed")
      self.embed_cells = EmbedSequence(
          [str(i) for i in range(8)],
          embedding_size,
          max_sequence_length=(H3_INPUT_SIZE - 4),
          representation="dense",
          embeddings_trainable=True,
          pretrained_embeddings=None,
          force_embedding_size=True,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
  
      logger.debug("  FCStack")
      self.fc_stack = FCStack(
          first_layer_input_size=embedding_size,
          layers=fc_layers,
          num_layers=num_fc_layers,
          default_output_size=output_size,
          default_use_bias=use_bias,
          default_weights_initializer=weights_initializer,
          default_bias_initializer=bias_initializer,
          default_norm=norm,
          default_norm_params=norm_params,
          default_activation=activation,
          default_dropout=dropout,
      )
  
imports: import logging
  from typing import Dict, List, Optional, Type
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import ENCODER_OUTPUT, ENCODER_OUTPUT_STATE, H3
  from ludwig.encoders.base import Encoder
  from ludwig.encoders.registry import register_encoder
  from ludwig.encoders.types import EncoderOutputDict
  from ludwig.modules.embedding_modules import Embed, EmbedSequence
  from ludwig.modules.fully_connected_modules import FCStack
  from ludwig.modules.initializer_modules import get_initializer
  from ludwig.modules.recurrent_modules import RecurrentStack
  from ludwig.modules.reduction_modules import SequenceReducer
  from ludwig.schema.encoders.base import BaseEncoderConfig
  from ludwig.schema.encoders.h3_encoders import H3EmbedConfig, H3RNNConfig, H3WeightedSumConfig
  from ludwig.utils import torch_utils
label_desc: Use image node_id 1 to create a new H3Embed object from inherited base classes: Encoder with example: obj = H3Embed(embedding_size, embeddings_on_cpu, fc_layers, num_fc_layers, output_size, use_bias, weights_initializer, bias_initializer, norm, norm_params, activation, dropout, reduce_output, encoder_config)