MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / __init__

Method __init__

model/transformer_encoder.py:52–56  ·  view source on GitHub ↗
(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1)

Source from the content-addressed store, hash-verified

50 ''' Compose with two layers '''
51
52 def __init__(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1):
53 super(EncoderLayer, self).__init__()
54 self.slf_attn = MultiHeadAttention(
55 n_head, d_model, d_k, d_v, dropout=dropout)
56 self.pos_ffn = PositionwiseFeedForward(d_model, d_inner, dropout=dropout)
57
58 def forward(self, enc_input, non_pad_mask=None, slf_attn_mask=None):
59 enc_output, enc_slf_attn = self.slf_attn(

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

MultiHeadAttentionClass · 0.90

Tested by

no test coverage detected