code: def __init__(
      self,
      vocab: List[str],
      embedding_size: int = 50,
      representation: str = "dense",
      embeddings_trainable: bool = True,
      pretrained_embeddings: Optional[str] = None,
      force_embedding_size: bool = False,
      embeddings_on_cpu: bool = False,
      fc_layers=None,
      num_fc_layers: int = 0,
      output_size: int = 10,
      use_bias: bool = True,
      weights_initializer: str = "xavier_uniform",
      bias_initializer: str = "zeros",
      norm: Optional[str] = None,
      norm_params: Optional[Dict[str, Any]] = None,
      activation: str = "relu",
      dropout: float = 0.0,
      encoder_config=None,
      **kwargs,
  ):
      super().__init__()
      self.config = encoder_config
  
      logger.debug(f" {self.name}")
  
      logger.debug("  EmbedWeighted")
      self.embed_weighted = EmbedWeighted(
          vocab,
          embedding_size,
          representation=representation,
          embeddings_trainable=embeddings_trainable,
          pretrained_embeddings=pretrained_embeddings,
          force_embedding_size=force_embedding_size,
          embeddings_on_cpu=embeddings_on_cpu,
          dropout=dropout,
          embedding_initializer=weights_initializer,
      )
      logger.debug("  FCStack")
      self.fc_stack = FCStack(
          self.embed_weighted.output_shape[-1],
          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,
      )
  
file_path: ludwig/ludwig/encoders/bag_encoders.py
imports: import logging
  from typing import Any, Dict, List, Optional, Type
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import BAG, ENCODER_OUTPUT
  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 EmbedWeighted
  from ludwig.modules.fully_connected_modules import FCStack
  from ludwig.schema.encoders.bag_encoders import BagEmbedWeightedConfig
  from ludwig.schema.encoders.base import BaseEncoderConfig
label_desc: Use image node_id 1 to create a new BagEmbedWeightedEncoder object from inherited base classes: Encoder with example: obj = BagEmbedWeightedEncoder(vocab, embedding_size, representation, embeddings_trainable, pretrained_embeddings, force_embedding_size, embeddings_on_cpu, fc_layers, num_fc_layers, output_size, use_bias, weights_initializer, bias_initializer, norm, norm_params, activation, dropout, encoder_config)