- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 vowpal wabbit 训练模型,并注意到一些非常奇怪的事情。在训练期间,报告的平均损失非常低,约为 0.06。然而,我注意到,当我要求模型预测相同训练数据的标签时,平均损失很高,约为 0.66,并且即使是训练数据,模型在预测标签方面也表现不佳。我最初的猜测是模型存在较高的偏差,因此我增加了模型的复杂性,在第一层使用 300 个隐藏节点,但问题仍然存在。
我非常感谢有关可能发生的情况的指示
大众汽车的教程幻灯片提到:“如果你在火车上测试,它有效吗?(没有=> 一些疯狂的事情)”
所以似乎正在发生一些非常疯狂的事情,我正在尝试了解我应该在哪里进行更深入的挖掘。
更多详情:我正在使用 vowpal wabbit 进行命名实体识别任务,其中特征是单词表示。我正在尝试使用具有多个隐藏单元的神经网络的多个模型,并尝试评估该模型。然而,我所有训练过的模型在对训练数据本身进行测试时都表现出较高的平均损失,我觉得这很奇怪。
这是重现该问题的一种方法:
训练输出:
vw -d ~/embeddings/eng_train_4.vw --loss_function logistic --oaa 6 --nn 32 -l 10 --random_weights 1 -f test_3.model --passes 4 -c
final_regressor = test_3.model
Num weight bits = 18
learning rate = 10
initial_t = 0
power_t = 0.5
decay_learning_rate = 1
using cache_file = /home/vvkulkarni/embeddings/eng_train_4.vw.cache
ignoring text input in favor of cache input
num sources = 1
average since example example current current current
loss last counter weight label predict features
0.666667 0.666667 3 3.0 1 1 577
0.833333 1.000000 6 6.0 1 2 577
0.818182 0.800000 11 11.0 4 4 577
0.863636 0.909091 22 22.0 1 4 577
0.636364 0.409091 44 44.0 1 1 577
0.390805 0.139535 87 87.0 1 1 577
0.258621 0.126437 174 174.0 1 1 577
0.160920 0.063218 348 348.0 1 1 577
0.145115 0.129310 696 696.0 1 1 577
0.138649 0.132184 1392 1392.0 1 1 577
0.122486 0.106322 2784 2784.0 1 1 577
0.097522 0.072557 5568 5568.0 1 1 577
0.076875 0.056224 11135 11135.0 1 1 577
0.058647 0.040417 22269 22269.0 1 1 577
0.047803 0.036959 44537 44537.0 1 1 577
0.038934 0.030066 89073 89073.0 1 1 577
0.036768 0.034601 178146 178146.0 1 1 577
0.032410 0.032410 356291 356291.0 1 1 577 h
0.029782 0.027155 712582 712582.0 1 1 577 h
finished run
number of examples per pass = 183259
passes used = 4
weighted example sum = 733036
weighted label sum = 0
average loss = 0.0276999
best constant = 0
total feature number = 422961744
现在,当我使用相同的数据(用于训练)评估上述模型时
vw -t ~/embeddings/eng_train_4.vw -i test_3.model -p test_3.pred
only testing
Num weight bits = 18
learning rate = 10
initial_t = 1
power_t = 0.5
predictions = test_3.pred
using no cache
Reading datafile = /home/vvkulkarni/embeddings/eng_train_4.vw
num sources = 1
average since example example current current current
loss last counter weight label predict features
0.333333 0.333333 3 3.0 1 1 577
0.500000 0.666667 6 6.0 1 4 577
0.636364 0.800000 11 11.0 6 3 577
0.590909 0.545455 22 22.0 1 1 577
0.500000 0.409091 44 44.0 4 1 577
0.482759 0.465116 87 87.0 1 1 577
0.528736 0.574713 174 174.0 1 3 577
0.500000 0.471264 348 348.0 1 3 577
0.517241 0.534483 696 696.0 6 1 577
0.536638 0.556034 1392 1392.0 4 4 577
0.560345 0.584052 2784 2784.0 1 5 577
0.560884 0.561422 5568 5568.0 6 2 577
0.586349 0.611820 11135 11135.0 1 1 577
0.560914 0.535477 22269 22269.0 1 1 577
0.557200 0.553485 44537 44537.0 1 1 577
0.568938 0.580676 89073 89073.0 1 2 577
0.560568 0.552199 178146 178146.0 1 1 577
finished run
number of examples per pass = 203621
passes used = 1
weighted example sum = 203621
weighted label sum = 0
average loss = 0.557428 <<< This is what is tricky.
best constant = -4.91111e-06
total feature number = 117489309
我尝试过的事情:1.我尝试将隐藏节点的数量增加到600,但没有成功。2.我还尝试使用具有 300 个隐藏节点的二次特征,但这也没有帮助。
尝试 1.) 和 2.) 的基本原理是假设高训练误差是由于高偏差造成的,从而增加模型复杂性。
更新:更有趣的是,如果我在测试阶段将传递次数指定为 4(即使我假设模型已经学习了决策边界),那么问题就会消失。我试图理解为什么?
vvkulkarni@einstein:/scratch1/vivek/test$ vw -t ~/embeddings/eng_train_4.vw -i test_3.model -p test_3_1.pred --passes 4 -c
only testing
Num weight bits = 18
learning rate = 10
initial_t = 1
power_t = 0.5
decay_learning_rate = 1
predictions = test_3_1.pred
using cache_file = /home/vvkulkarni/embeddings/eng_train_4.vw.cache
ignoring text input in favor of cache input
num sources = 1
average since example example current current current
loss last counter weight label predict features
0.333333 0.333333 3 3.0 1 1 577
0.166667 0.000000 6 6.0 1 1 577
0.090909 0.000000 11 11.0 4 4 577
0.045455 0.000000 22 22.0 1 1 577
0.022727 0.000000 44 44.0 1 1 577
0.011494 0.000000 87 87.0 1 1 577
0.017241 0.022989 174 174.0 1 1 577
0.022989 0.028736 348 348.0 1 1 577
0.020115 0.017241 696 696.0 1 1 577
0.043822 0.067529 1392 1392.0 1 1 577
0.031968 0.020115 2784 2784.0 1 1 577
0.031968 0.031968 5568 5568.0 1 1 577
0.032959 0.033950 11135 11135.0 1 1 577
0.029952 0.026944 22269 22269.0 1 1 577
0.029212 0.028471 44537 44537.0 1 1 577
0.030481 0.031750 89073 89073.0 1 1 577
0.028673 0.026866 178146 178146.0 1 1 577
0.034001 0.034001 356291 356291.0 1 1 577 h
0.034026 0.034051 712582 712582.0 1 1 577 h
最佳答案
您存在哈希冲突,因为您的特征比哈希中的空格多得多。
默认哈希大小为 18 位或 262144 个空格。根据您的第一个打印输出,有 422961744 个功能至少需要 27 位,因此您应该在命令行中添加 -b27 (或更多)。
我没有你的输入文件,所以我无法尝试并查看..但这是检查冲突的一种方法:
运行你的学习阶段并添加 --invert_hash 最终然后检查与这些线的碰撞:
tail -n +13 final | sort -n -k 2 -t ':' | wc -l
tail -n +13 final | sort -nu -k 2 -t ':' | wc -l
输出的值应该相同。我从 Vowpal Wabbit 的创建者 John Langford 那里得到了这个提示。
关于machine-learning - 当要求在训练集上进行预测时,训练集上的误差较高,但训练时的平均损失较低,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19017972/
我正在尝试用 java 编写具有以下输出的 java 代码。 ---JGRASP exez: java Guess Is the number 50? H Ia the number
如果查看 Azure 存储中磁盘的定价等级(截至目前,美国东部地区的高级 SSD 低于一级),就会发现提供的 IOPS 越高,磁盘大小就越大。 人们可以选择更高的性能层,但使用较小的磁盘大小(尽管这可
如果查看 Azure 存储中磁盘的定价等级(截至目前,美国东部地区的高级 SSD 低于一级),就会发现提供的 IOPS 越高,磁盘大小就越大。 人们可以选择更高的性能层,但使用较小的磁盘大小(尽管这可
我是 azurewebsites 服务的新用户,我很高兴为什么我的网站发送了太多数据。服务器在 8 小时内输出了 55GB 数据。我的网站不包含任何大文件,它只是一个名片网站。我如何检查发生了什么?此
我希望我的 Bootstrap 轮播在图像上方有一个点覆盖。 Carousel Caption 应位于虚线叠加层之上。我无法让它与 z-indexes 一起工作。 我做错了什么吗? (可能安静 :-)
我正在使用动态编程来解决一个问题,其中我将得到 n 并且需要输出最小数量的操作以通过使用这三个操作(-1,/2,/3)从 n 中获得 1。给定约束(1 using namespace std; int
我需要在左右栏之间放置内容,前提是内容 block 高于左右栏 block 。我试着用 float: right;在内容的样式中,它只对齐图中的示例。 如何使列之间的内容 block 居中?我的代码是
我有一个非常简单的网页设置,由 div、标题和 i 元素组成的网格: 我想要做的就是在这个网格后面添加一个带有背景颜色和标题的 div,网格的元素出现在新背景 div 的顶部。 但是,当我尝试这样做时
大家,我是数据科学的新手。我正在使用支持向量回归来解决回归问题。使用网格搜索调整 SVM 参数后,我得到了 2.6% MAPE,但我的 MAE 和 MSE 仍然非常高。 我为mape使用了用户定义的函
我是一名优秀的程序员,十分优秀!