http://www.manongjc.com/detail/12-lpvwxodxyzdvmkv.html
https://www.freesion.com/article/5392665265/
dk的由来

multihead的参数计算

class BertEmbeddings(nn.Module):
"""Construct the embeddings from word, position and token_type embeddings.
"""
def __init__(self, config):
super(BertEmbeddings, self).__init__()
self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size)
self.position_embeddings = nn.Embedding(config.max_position_embeddings, config.hidden_size)
self.token_type_embeddings = nn.Embedding(config.type_vocab_size, config.hidden_size)
本文详细介绍了BertEmbeddings类的实现方式,包括词嵌入(word embeddings)、位置嵌入(position embeddings)和类型嵌入(token_type embeddings)的具体构造方法。
3万+

被折叠的 条评论
为什么被折叠?



