class_docstr: Simple TwoTower (UV) Model. Embeds two different entities into the same space.
  A simplified version of the `A Dual Augmented Two-tower Model for Online Large-scale Recommendation
  <https://dlp-kdd.github.io/assets/pdf/DLP-KDD_2021_paper_4.pdf>`_ model.
  Used to train the retrieval model
  
  Embeddings trained with this model will be indexed and queried in the retrieval example.
  
  Args:
      embedding_bag_collection (EmbeddingBagCollection): embedding_bag_collection with two EmbeddingBags
      layer_sizes (List[int]): list of the layer_sizes for the MLP
      device (Optional[torch.device])
  
  Example::
  
      m = TwoTower(ebc, [16, 8], device)
code: def __init__(
      self,
      embedding_bag_collection: EmbeddingBagCollection,
      layer_sizes: List[int],
      device: Optional[torch.device] = None,
  ) -> None:
      super().__init__()
      # If running this example on Torcherc < v0.2.0,
      # please use embedding_bag_configs as a property, not a function
      assert (
          len(embedding_bag_collection.embedding_bag_configs()) == 2
      ), "Expected two EmbeddingBags in the two tower model"
      assert (
          embedding_bag_collection.embedding_bag_configs()[
              0
          ].embedding_dim
          == embedding_bag_collection.embedding_bag_configs()[
              1
          ].embedding_dim
      ), "Both EmbeddingBagConfigs must have the same dimension"
      embedding_dim: int = (
          embedding_bag_collection.embedding_bag_configs()[
              0
          ].embedding_dim
      )
      self._feature_names_query: List[
          str
      ] = embedding_bag_collection.embedding_bag_configs()[
          0
      ].feature_names
      self._candidate_feature_names: List[
          str
      ] = embedding_bag_collection.embedding_bag_configs()[
          1
      ].feature_names
      self.ebc = embedding_bag_collection
      self.query_proj = MLP(
          in_size=embedding_dim, layer_sizes=layer_sizes, device=device
      )
      self.candidate_proj = MLP(
          in_size=embedding_dim, layer_sizes=layer_sizes, device=device
      )
  
imports: from typing import Any, List, Mapping, Optional, OrderedDict, Tuple, Union
  import faiss
  import faiss.contrib.torch_utils
  import torch
  from torch import nn
  from torchrec.datasets.utils import Batch
  from torchrec.modules.embedding_modules import EmbeddingBagCollection
  from torchrec.modules.mlp import MLP
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
label_desc: Use image node_id 1 to create a new TwoTower object from inherited base classes: nn with example: obj = TwoTower(embedding_bag_collection, layer_sizes, device)