问题描述
评估模型时 HuggingFace 中 Trainer(...)
的默认行为是禁用 Dropout。具体来说,y_pred
的 M
运行将完全相同
for i in range(M):
logits,labels,metrics = trainer.predict(tokenized_datasets["eval"])
y_pred = np.argmax(logits,axis=2)
...
现在我正在尝试应用 this this answer 引入的 Monte Carlo Dropout 技巧。这需要在对验证集进行预测时打开 Dropout打开。
我想知道我是如何实现这个目标的。任何输入表示赞赏。