摘要:
1. word tokenizer word base方法简单易理解,每个word都分配一个ID,则所需的Vocabulary则根据语料大小而不同,而且这种分词方式,会将两个本身意思一致的词分成两个毫不同的ID,在英文中尤为明显,如cat, cats。 2. character tokenizer 阅读全文
摘要:
import torch import torch.nn as nn from math import sqrt class SelfAttention(nn.Module): def __init__(self, input_dim, dim_q_k, dim_v): self.q = nn.Li 阅读全文