[linux] bert预训练,检查emb是否参与训练

# Attention! check if EMBEDDING LAYER is trained ! e.g. bert.embeddings.word_embeddings.weight
for name, param in self.model.named_parameters():
    if 'embeddings' in name and not param.requires_grad:
        param.requires_grad = True
## 检查emb层是否参与训练

猜你喜欢

转载自blog.csdn.net/Trance95/article/details/131204465
今日推荐