bert4pytorch
bert4pytorch copied to clipboard
超轻量级bert的pytorch版本,大量中文注释,容易修改结构,持续更新
现在版本的分词似乎是不支持批量数据加载的,是吗?
看到另外一个仓库[bert4torch](https://github.com/Tongjilibo/bert4torch),感觉改写的有点类似啊
modelling文件中variable mapping函数中的mapping存在bug. hugging face的模型文件中layerNorm参数用的是gamma和beta, 作者给的是weight bias, 不匹配
比如 bert-base-chinese,作者是否有做过这方面的评估测试呀~
Transformer Quality in Linear Time Weizhe Hua, Zihang Dai, Hanxiao Liu, Quoc V. Le We revisit the design choices in Transformers, and propose methods to address their weaknesses in handling...
有人知道这个问题改怎么解决吗 File "F:\software\Anaconda\envs\tensor\lib\site-packages\bert4pytorch\modeling.py", line 71, in load_weights_from_pytorch_checkpoint state_dict[new_key] = state_dict.pop(old_key) KeyError: 'bert.embeddings.LayerNorm.gamma'
LabelSmoothingCrossEntropy这个函数最终返回的总loss的前半部分: loss*self.eps/c ,这里c是类别个数,我发现有的公式里写的这里应该是除以类别个数减一。 请教一下到底要不要减一
if conditional: self.dense1 = nn.Linear(2 * hidden_size, hidden_size, bias=False) self.dense.weight.data.uniform_(0, 0) -------> 此处应该self.dense1, 下边的self.dense2 也是一样的
可以加载bert4keras里面提供的模型吗