【问题标题】:Machine Learning, Transformer, Multi-class classification, number of classes is inconsistent in test data and training data机器学习,Transformer,多类分类,测试数据和训练数据的类数不一致
【发布时间】:2022-01-19 01:53:42
【问题描述】:

例如,假设我正在构建一个 Transformer 模型(来自 huggingface),训练数据中有 20 个类,但测试数据中只有 5 个类。要从 huggingface 配置 Transformer 模型,例如 BertConfig,我们需要提供一个参数:num_labels。我应该将 num_labels 设置为 20 还是 5,因为测试数据中只有 5 个类?

【问题讨论】:

    标签: machine-learning huggingface-transformers bert-language-model


    【解决方案1】:

    20.因为您训练的网络有 20 个类。

    【讨论】:

      猜你喜欢
      • 2020-02-21
      • 1970-01-01
      • 2019-07-03
      • 2016-12-03
      • 2019-10-26
      • 2015-12-21
      • 2020-04-17
      • 2017-11-03
      • 2020-04-30
      相关资源
      最近更新 更多