MCPcopy Create free account
hub / github.com/ACL2020SpellGCN/SpellGCN / transformer_model

Function transformer_model

modeling.py:753–891  ·  view source on GitHub ↗

Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder. See the original paper: https://arxiv.org/abs/1706.03762 Also see: https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/mo

(input_tensor,
                      attention_mask=None,
                      hidden_size=768,
                      num_hidden_layers=12,
                      num_attention_heads=12,
                      intermediate_size=3072,
                      intermediate_act_fn=gelu,
                      hidden_dropout_prob=0.1,
                      attention_probs_dropout_prob=0.1,
                      initializer_range=0.02,
                      do_return_all_layers=False)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

__init__Method · 0.85

Calls 7

get_shape_listFunction · 0.85
reshape_to_matrixFunction · 0.85
attention_layerFunction · 0.85
create_initializerFunction · 0.85
dropoutFunction · 0.85
layer_normFunction · 0.85
reshape_from_matrixFunction · 0.85

Tested by

no test coverage detected