class_docstr: The Scaled Dot Production Attention operation from `Attention Is All You Need <https://arxiv.org/abs/1706.03762>_` paper.
  
  Example
  -------
  >>> from deepchem.models import ScaledDotProductAttention as SDPA
  >>> attn = SDPA()
  >>> x = torch.ones(1, 5)
  >>> # Linear layers for making query, key, value
  >>> Q, K, V = nn.Parameter(torch.ones(5)), nn.Parameter(torch.ones(5)), nn.Parameter(torch.ones(5))
  >>> query, key, value = Q * x, K * x, V * x
  >>> x_out, attn_score = attn(query, key, value)
class_docstr_tok: ["The","Scaled","Dot","Production","Attention","operation","from","`","Attention","Is","All","You","Need","<","https",":","\/\/arxiv.org\/abs\/1706.03762",">","_","`","paper",".","Example","--","--","--","-",">",">",">","from","deepchem.models","import","ScaledDotProductAttention","as","SDPA",">",">",">","attn","=","SDPA","(",")",">",">",">","x","=","torch.ones","(","1",",","5",")",">",">",">","#","Linear","layers","for","making","query",",","key",",","value",">",">",">","Q",",","K",",","V","=","nn.Parameter","(","torch.ones","(","5",")",")",",","nn.Parameter","(","torch.ones","(","5",")",")",",","nn.Parameter","(","torch.ones","(","5",")",")",">",">",">","query",",","key",",","value","=","Q","*","x",",","K","*","x",",","V","*","x",">",">",">","x_out",",","attn_score","=","attn","(","query",",","key",",","value",")"]
code: def __init__(self):
      self.epsilon = -1e9
      super(ScaledDotProductAttention, self).__init__()
  
file_path: deepchem/deepchem/models/torch_models/attention.py
imports: import math
  from typing import Optional
label_desc: Use image node_id 1 to create a new ScaledDotProductAttention object from inherited base classes: nn with example: obj = ScaledDotProductAttention()