class_docstr: Given sequence P and vector q, computes attention weights for each element
  in P by matching q with each element in P using multiplicative attention.
  * a_i = softmax(p_i . W . q)
class_docstr_tok: ["Given","sequence","P","and","vector","q",",","computes","attention","weights","for","each","element","in","P","by","matching","q","with","each","element","in","P","using","multiplicative","attention",".","*","a_i","=","softmax","(","p_i",".","W",".","q",")"]
code: def __init__(self, p_hidden_dim, q_hidden_dim, normalize):
      super().__init__()
      self.normalize = normalize
      self.linear = nn.Linear(p_hidden_dim, q_hidden_dim)
      log_class_usage(__class__)
  
file_path: pytext/pytext/models/representations/attention.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from pytext.models.module import Module
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 2 to create a new MultiplicativeAttention object from inherited base classes: Module with example: obj = MultiplicativeAttention(p_hidden_dim, q_hidden_dim, normalize)