MCPcopy Create free account
hub / github.com/apache/singa / __init__

Method __init__

examples/trans/model.py:223–232  ·  view source on GitHub ↗
(self, d_model=512, n_head=8, dim_feedforward=2048)

Source from the content-addressed store, hash-verified

221
222class TransformerDecoderLayer(layer.Layer):
223 def __init__(self, d_model=512, n_head=8, dim_feedforward=2048):
224 super(TransformerDecoderLayer, self).__init__()
225
226 self.d_model = d_model
227 self.n_head = n_head
228 self.dim_feedforward = dim_feedforward
229
230 self.dec_self_attn = MultiHeadAttention(d_model=d_model, n_head=n_head)
231 self.dec_enc_attn = MultiHeadAttention(d_model=d_model, n_head=n_head)
232 self.pos_ffn = PoswiseFeedForwardNet(d_model=d_model, dim_feedforward=dim_feedforward)
233
234 def forward(self, dec_inputs, enc_outputs, dec_self_attn_mask, dec_enc_attn_mask):
235 """

Callers

nothing calls this directly

Calls 3

MultiHeadAttentionClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected