class_docstr: Processes the output of both `SparseArch` (sparse_features) and `DenseArch`
  (dense_features) and apply the general DeepFM interaction according to the
  external source of DeepFM paper: https://arxiv.org/pdf/1703.04247.pdf
  
  The output dimension is expected to be a cat of `dense_features`, D.
  
  Args:
      fm_in_features (int): the input dimension of `dense_module` in DeepFM. For
          example, if the input embeddings is [randn(3, 2, 3), randn(3, 4, 5)], then
          the `fm_in_features` should be: 2 * 3 + 4 * 5.
      sparse_feature_names (List[str]): length of F.
      deep_fm_dimension (int): output of the deep interaction (DI) in the DeepFM arch.
  
  Example::
  
      D = 3
      B = 10
      keys = ["f1", "f2"]
      F = len(keys)
      fm_inter_arch = FMInteractionArch(sparse_feature_names=keys)
      dense_features = torch.rand((B, D))
      sparse_features = KeyedTensor(
          keys=keys,
          length_per_key=[D, D],
          values=torch.rand((B, D * F)),
      )
      cat_fm_output = fm_inter_arch(dense_features, sparse_features)
class_docstr_tok: ["Processes","the","output","of","both","`","SparseArch","`","(","sparse_features",")","and","`","DenseArch","`","(","dense_features",")","and","apply","the","general","DeepFM","interaction","according","to","the","external","source","of","DeepFM","paper",":","https",":","\/\/arxiv.org\/pdf\/1703.04247.pdf","The","output","dimension","is","expected","to","be","a","cat","of","`","dense_features","`",",","D.","Args",":","fm_in_features","(","int",")",":","the","input","dimension","of","`","dense_module","`","in","DeepFM",".","For","example",",","if","the","input","embeddings","is","[","randn","(","3",",","2",",","3",")",",","randn","(","3",",","4",",","5",")","]",",","then","the","`","fm_in_features","`","should","be",":","2","*","3","+","4","*","5.","sparse_feature_names","(","List","[","str","]",")",":","length","of","F.","deep_fm_dimension","(","int",")",":","output","of","the","deep","interaction","(","DI",")","in","the","DeepFM","arch",".","Example",":",":","D","=","3","B","=","10","keys","=","[","``","f1","''",",","``","f2","''","]","F","=","len","(","keys",")","fm_inter_arch","=","FMInteractionArch","(","sparse_feature_names=keys",")","dense_features","=","torch.rand","(","(","B",",","D",")",")","sparse_features","=","KeyedTensor","(","keys=keys",",","length_per_key=","[","D",",","D","]",",","values=torch.rand","(","(","B",",","D","*","F",")",")",",",")","cat_fm_output","=","fm_inter_arch","(","dense_features",",","sparse_features",")"]
code: def __init__(
      self,
      fm_in_features: int,
      sparse_feature_names: List[str],
      deep_fm_dimension: int,
  ) -> None:
      super().__init__()
      self.sparse_feature_names: List[str] = sparse_feature_names
      self.deep_fm = DeepFM(
          dense_module=nn.Sequential(
              nn.Linear(fm_in_features, deep_fm_dimension),
              nn.ReLU(),
          )
      )
      self.fm = FactorizationMachine()
  
imports: from typing import List
  import torch
  from torch import nn
  from torchrec import EmbeddingBagCollection, KeyedJaggedTensor
  from torchrec.modules.deepfm import DeepFM, FactorizationMachine
  from torchrec.sparse.jagged_tensor import KeyedTensor
label_desc: Use image node_id 1 to create a new FMInteractionArch object from inherited base classes: nn with example: obj = FMInteractionArch(fm_in_features, sparse_feature_names, deep_fm_dimension)