我正在訓練使用vowpal wabbit的模型並注意到一些非常奇怪的事情。在培訓期間,報告的平均損失非常低,約爲0.06。但是我注意到,當我讓模型預測相同訓練數據上的標籤時,平均損失在〜0.66附近很高,即使是訓練數據,模型預測標籤的效果也很差。我最初的猜想是模型遭受了很大的偏見,因此我增加了模型的複雜性,以便在第一層使用300個隱藏節點,但問題依然存在。當被要求預測訓練集但訓練較低時的平均損失時,訓練集上的高錯誤
我將不勝感激什麼可以在
教程幻燈片VW被去指針提到: 「如果你在火車上組測試,它的工作原理(無 =>一些瘋狂的)?」
因此,一些非常瘋狂的事情似乎正在發生,我試圖理解我應該更深入挖掘的可能性。
更多詳細信息: 我正在使用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(即使我假設模型已經學會了決策邊界),那麼問題就會消失。我想明白爲什麼?
[email protected]:/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
你應該包括**更多的**細節。簡短,可重複的代碼是必需的任何幫助 – lejlot
Thanks.I已添加我使用的模型的細節。還添加了命令行,我和他們的輸出一起用來精確地指出問題,也是我嘗試過的。請讓我知道是否需要任何具體細節。 – vvknitk
你確定你正在測試相同的數據嗎?請注意,對於相同的示例編號,兩次運行中的「當前標籤」是不同的,當我期望它們在相同的數據上相同時。另一個可疑的事情是,即使在爲訓練集(訓練步驟)創建高速緩存之後,測試步驟似乎也不會使用高速緩存... – arielf