MCPcopy
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / __init__

Method __init__

model/layers.py:51–57  ·  view source on GitHub ↗
(self, dim, dropout=0)

Source from the content-addressed store, hash-verified

49 """
50
51 def __init__(self, dim, dropout=0):
52 super(AdditiveAttention, self).__init__()
53 self.w_attention_matrix = init_tensor(torch.empty(dim, dim))
54 self.u_attention_matrix = init_tensor(torch.empty(dim, dim))
55 self.v_attention_vector = init_tensor(torch.empty(dim, 1))
56
57 self.dropout = torch.nn.Dropout(p=dropout)
58
59 def forward(self, s, h):
60 raise NotImplementedError

Callers

nothing calls this directly

Calls 2

init_tensorFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected