It's a long long time since I used srilm, thanks for the python bindings.
All worked swimmingly, except the MaxentLm test failed. I don't need this, so I'm good, just thought I'd report it as others may well have the same. I'm Ubuntu 22.04.1 LTS, srilm-1.7.3, everything done according to your instructions except I removed 'iconv' from setup.py as I didn't have libiconv and didn't seem to need it.
think0 tonyr: make
python3 -m unittest discover -v tests/
test_estimate (test_discount.TestNgramDiscount) ... ok
test_init (test_discount.TestNgramDiscount) ... ok
test_read_write (test_discount.TestNgramDiscount) ... ok
test_order (test_maxent.TestMaxentLm) ... ok
test_prob (test_maxent.TestMaxentLm) ... Starting fitting...
Starting OWL-BFGS with c1=0.000456204, sigma2=6576, max_iters=1000
No of NaNs in logZs: 0, No infs: 0
dual is 4.68213
regularized dual is 4.68213
norm of gradient =0.424182
norm of regularized gradient =0.424182
No of NaNs in logZs: 0, No infs: 0
dual is 4.26599
regularized dual is 4.26607
norm of gradient =0.405679
norm of regularized gradient =0.405527
Iteration 1
No of NaNs in logZs: 0, No infs: 0
dual is 12.6053
regularized dual is 12.6493
norm of gradient =0.702017
norm of regularized gradient =0.704752
No of NaNs in logZs: 0, No infs: 0
dual is 6.60097
regularized dual is 6.61289
norm of gradient =0.700588
norm of regularized gradient =0.702018
No of NaNs in logZs: 0, No infs: 0
dual is 3.77496
regularized dual is 3.77842
norm of gradient =0.540149
norm of regularized gradient =0.540885
Iteration 2
No of NaNs in logZs: 0, No infs: 0
dual is 3.20445
regularized dual is 3.20612
norm of gradient =0.142862
norm of regularized gradient =0.142163
Iteration 3
No of NaNs in logZs: 0, No infs: 0
dual is 3.10224
regularized dual is 3.10467
norm of gradient =0.0930172
norm of regularized gradient =0.0926131
Iteration 4
No of NaNs in logZs: 0, No infs: 0
dual is 3.00898
regularized dual is 3.01256
norm of gradient =0.099428
norm of regularized gradient =0.0990038
Iteration 5
No of NaNs in logZs: 0, No infs: 0
dual is 2.94199
regularized dual is 2.94677
norm of gradient =0.0660072
norm of regularized gradient =0.0657694
Iteration 6
No of NaNs in logZs: 0, No infs: 0
dual is 2.88191
regularized dual is 2.88783
norm of gradient =0.0590299
norm of regularized gradient =0.0590307
Iteration 7
No of NaNs in logZs: 0, No infs: 0
dual is 2.81161
regularized dual is 2.81963
norm of gradient =0.0470536
norm of regularized gradient =0.0467976
Iteration 8
No of NaNs in logZs: 0, No infs: 0
dual is 2.74549
regularized dual is 2.75595
norm of gradient =0.0400534
norm of regularized gradient =0.0395721
Iteration 9
No of NaNs in logZs: 0, No infs: 0
dual is 2.64902
regularized dual is 2.66465
norm of gradient =0.0348613
norm of regularized gradient =0.0342515
Iteration 10
No of NaNs in logZs: 0, No infs: 0
dual is 2.50365
regularized dual is 2.53153
norm of gradient =0.0706963
norm of regularized gradient =0.0704513
Iteration 11
No of NaNs in logZs: 0, No infs: 0
dual is 2.36064
regularized dual is 2.4049
norm of gradient =0.0920386
norm of regularized gradient =0.0911455
Iteration 12
No of NaNs in logZs: 0, No infs: 0
dual is 2.27304
regularized dual is 2.32685
norm of gradient =0.0343558
norm of regularized gradient =0.0323156
Iteration 13
No of NaNs in logZs: 0, No infs: 0
dual is 2.16259
regularized dual is 2.23523
norm of gradient =0.0279268
norm of regularized gradient =0.0254337
Iteration 14
No of NaNs in logZs: 0, No infs: 0
dual is 2.09053
regularized dual is 2.17633
norm of gradient =0.0421421
norm of regularized gradient =0.0403006
Iteration 15
No of NaNs in logZs: 0, No infs: 0
dual is 2.03505
regularized dual is 2.13228
norm of gradient =0.0271689
norm of regularized gradient =0.024379
Iteration 16
No of NaNs in logZs: 0, No infs: 0
dual is 2.01308
regularized dual is 2.11385
norm of gradient =0.021937
norm of regularized gradient =0.0180038
Iteration 17
No of NaNs in logZs: 0, No infs: 0
dual is 1.9581
regularized dual is 2.0703
norm of gradient =0.024164
norm of regularized gradient =0.020173
Iteration 18
No of NaNs in logZs: 0, No infs: 0
dual is 1.91613
regularized dual is 2.03855
norm of gradient =0.0230848
norm of regularized gradient =0.0186832
Iteration 19
No of NaNs in logZs: 0, No infs: 0
dual is 1.87709
regularized dual is 2.01744
norm of gradient =0.101709
norm of regularized gradient =0.101195
No of NaNs in logZs: 0, No infs: 0
dual is 1.88923
regularized dual is 2.01995
norm of gradient =0.0485505
norm of regularized gradient =0.0469903
Iteration 20
No of NaNs in logZs: 0, No infs: 0
dual is 1.87557
regularized dual is 2.00922
norm of gradient =0.0200276
norm of regularized gradient =0.0148839
Iteration 21
No of NaNs in logZs: 0, No infs: 0
dual is 1.87054
regularized dual is 2.00577
norm of gradient =0.019616
norm of regularized gradient =0.0141275
Iteration 22
No of NaNs in logZs: 0, No infs: 0
dual is 1.86262
regularized dual is 2.0008
norm of gradient =0.0195721
norm of regularized gradient =0.0139688
Iteration 23
No of NaNs in logZs: 0, No infs: 0
dual is 1.86826
regularized dual is 2.00589
norm of gradient =0.0233995
norm of regularized gradient =0.0190818
No of NaNs in logZs: 0, No infs: 0
dual is 1.86482
regularized dual is 2.00263
norm of gradient =0.0202747
norm of regularized gradient =0.0149986
Iteration 24
No of NaNs in logZs: 0, No infs: 0
dual is 1.86117
regularized dual is 2.00053
norm of gradient =0.0204487
norm of regularized gradient =0.0150996
Iteration 25
No of NaNs in logZs: 0, No infs: 0
dual is 1.86038
regularized dual is 2.00014
norm of gradient =0.0197198
norm of regularized gradient =0.0141236
Iteration 26
No of NaNs in logZs: 0, No infs: 0
dual is 1.85947
regularized dual is 1.99986
norm of gradient =0.0197912
norm of regularized gradient =0.014258
Iteration 27
No of NaNs in logZs: 0, No infs: 0
dual is 1.85859
regularized dual is 1.99951
norm of gradient =0.0198709
norm of regularized gradient =0.0142521
Iteration 28
No of NaNs in logZs: 0, No infs: 0
dual is 1.85683
regularized dual is 1.99866
norm of gradient =0.0207602
norm of regularized gradient =0.0157125
Iteration 29
No of NaNs in logZs: 0, No infs: 0
dual is 1.85675
regularized dual is 1.99861
norm of gradient =0.019597
norm of regularized gradient =0.0139656
Iteration 30
No of NaNs in logZs: 0, No infs: 0
dual is 1.85668
regularized dual is 1.9986
norm of gradient =0.0197068
norm of regularized gradient =0.0140497
Iteration 31
No of NaNs in logZs: 0, No infs: 0
dual is 1.85674
regularized dual is 1.9987
norm of gradient =0.0196683
norm of regularized gradient =0.0139978
Iteration 32
No of NaNs in logZs: 0, No infs: 0
dual is 1.85709
regularized dual is 1.99924
norm of gradient =0.0198983
norm of regularized gradient =0.014353
Iteration 33
No of NaNs in logZs: 0, No infs: 0
dual is 1.85676
regularized dual is 1.99913
norm of gradient =0.0196602
norm of regularized gradient =0.0140289
Iteration 34
No of NaNs in logZs: 0, No infs: 0
dual is 1.85656
regularized dual is 1.99906
norm of gradient =0.0196105
norm of regularized gradient =0.0139592
Iteration 35
No of NaNs in logZs: 0, No infs: 0
dual is 1.85622
regularized dual is 1.99905
norm of gradient =0.019561
norm of regularized gradient =0.0139033
Iteration 36
No of NaNs in logZs: 0, No infs: 0
dual is 1.85632
regularized dual is 1.99923
norm of gradient =0.0195582
norm of regularized gradient =0.0139196
Iteration 37
No of NaNs in logZs: 0, No infs: 0
dual is 1.85641
regularized dual is 1.99941
norm of gradient =0.0207849
norm of regularized gradient =0.0154313
No of NaNs in logZs: 0, No infs: 0
dual is 1.85634
regularized dual is 1.99929
norm of gradient =0.0198557
norm of regularized gradient =0.0142442
Iteration 38
No of NaNs in logZs: 0, No infs: 0
dual is 1.85643
regularized dual is 1.9994
norm of gradient =0.0196162
norm of regularized gradient =0.0139561
Iteration 39
OWL-BFGS terminated with the stopping criterion
Duration: 0 seconds
FAIL
test_read_write (test_maxent.TestMaxentLm) ... Starting fitting...
Starting OWL-BFGS with c1=0.000456204, sigma2=6576, max_iters=1000
No of NaNs in logZs: 0, No infs: 0
dual is 4.68213
regularized dual is 4.68213
norm of gradient =0.424182
norm of regularized gradient =0.424182
No of NaNs in logZs: 0, No infs: 0
dual is 4.26599
regularized dual is 4.26607
norm of gradient =0.405679
norm of regularized gradient =0.405527
Iteration 1
No of NaNs in logZs: 0, No infs: 0
dual is 12.6053
regularized dual is 12.6493
norm of gradient =0.702017
norm of regularized gradient =0.704752
No of NaNs in logZs: 0, No infs: 0
dual is 6.60097
regularized dual is 6.61289
norm of gradient =0.700588
norm of regularized gradient =0.702018
No of NaNs in logZs: 0, No infs: 0
dual is 3.77496
regularized dual is 3.77842
norm of gradient =0.540149
norm of regularized gradient =0.540885
Iteration 2
No of NaNs in logZs: 0, No infs: 0
dual is 3.20445
regularized dual is 3.20612
norm of gradient =0.142862
norm of regularized gradient =0.142163
Iteration 3
No of NaNs in logZs: 0, No infs: 0
dual is 3.10224
regularized dual is 3.10467
norm of gradient =0.0930172
norm of regularized gradient =0.0926131
Iteration 4
No of NaNs in logZs: 0, No infs: 0
dual is 3.00898
regularized dual is 3.01256
norm of gradient =0.099428
norm of regularized gradient =0.0990038
Iteration 5
No of NaNs in logZs: 0, No infs: 0
dual is 2.94199
regularized dual is 2.94677
norm of gradient =0.0660072
norm of regularized gradient =0.0657694
Iteration 6
No of NaNs in logZs: 0, No infs: 0
dual is 2.88191
regularized dual is 2.88783
norm of gradient =0.0590299
norm of regularized gradient =0.0590307
Iteration 7
No of NaNs in logZs: 0, No infs: 0
dual is 2.81161
regularized dual is 2.81963
norm of gradient =0.0470536
norm of regularized gradient =0.0467976
Iteration 8
No of NaNs in logZs: 0, No infs: 0
dual is 2.74549
regularized dual is 2.75595
norm of gradient =0.0400534
norm of regularized gradient =0.0395721
Iteration 9
No of NaNs in logZs: 0, No infs: 0
dual is 2.64902
regularized dual is 2.66465
norm of gradient =0.0348613
norm of regularized gradient =0.0342515
Iteration 10
No of NaNs in logZs: 0, No infs: 0
dual is 2.50365
regularized dual is 2.53153
norm of gradient =0.0706963
norm of regularized gradient =0.0704513
Iteration 11
No of NaNs in logZs: 0, No infs: 0
dual is 2.36064
regularized dual is 2.4049
norm of gradient =0.0920386
norm of regularized gradient =0.0911455
Iteration 12
No of NaNs in logZs: 0, No infs: 0
dual is 2.27304
regularized dual is 2.32685
norm of gradient =0.0343558
norm of regularized gradient =0.0323156
Iteration 13
No of NaNs in logZs: 0, No infs: 0
dual is 2.16259
regularized dual is 2.23523
norm of gradient =0.0279268
norm of regularized gradient =0.0254337
Iteration 14
No of NaNs in logZs: 0, No infs: 0
dual is 2.09053
regularized dual is 2.17633
norm of gradient =0.0421421
norm of regularized gradient =0.0403006
Iteration 15
No of NaNs in logZs: 0, No infs: 0
dual is 2.03505
regularized dual is 2.13228
norm of gradient =0.0271689
norm of regularized gradient =0.024379
Iteration 16
No of NaNs in logZs: 0, No infs: 0
dual is 2.01308
regularized dual is 2.11385
norm of gradient =0.021937
norm of regularized gradient =0.0180038
Iteration 17
No of NaNs in logZs: 0, No infs: 0
dual is 1.9581
regularized dual is 2.0703
norm of gradient =0.024164
norm of regularized gradient =0.020173
Iteration 18
No of NaNs in logZs: 0, No infs: 0
dual is 1.91613
regularized dual is 2.03855
norm of gradient =0.0230848
norm of regularized gradient =0.0186832
Iteration 19
No of NaNs in logZs: 0, No infs: 0
dual is 1.87709
regularized dual is 2.01744
norm of gradient =0.101709
norm of regularized gradient =0.101195
No of NaNs in logZs: 0, No infs: 0
dual is 1.88923
regularized dual is 2.01995
norm of gradient =0.0485505
norm of regularized gradient =0.0469903
Iteration 20
No of NaNs in logZs: 0, No infs: 0
dual is 1.87557
regularized dual is 2.00922
norm of gradient =0.0200276
norm of regularized gradient =0.0148839
Iteration 21
No of NaNs in logZs: 0, No infs: 0
dual is 1.87054
regularized dual is 2.00577
norm of gradient =0.019616
norm of regularized gradient =0.0141275
Iteration 22
No of NaNs in logZs: 0, No infs: 0
dual is 1.86262
regularized dual is 2.0008
norm of gradient =0.0195721
norm of regularized gradient =0.0139688
Iteration 23
No of NaNs in logZs: 0, No infs: 0
dual is 1.86826
regularized dual is 2.00589
norm of gradient =0.0233995
norm of regularized gradient =0.0190818
No of NaNs in logZs: 0, No infs: 0
dual is 1.86482
regularized dual is 2.00263
norm of gradient =0.0202747
norm of regularized gradient =0.0149986
Iteration 24
No of NaNs in logZs: 0, No infs: 0
dual is 1.86117
regularized dual is 2.00053
norm of gradient =0.0204487
norm of regularized gradient =0.0150996
Iteration 25
No of NaNs in logZs: 0, No infs: 0
dual is 1.86038
regularized dual is 2.00014
norm of gradient =0.0197198
norm of regularized gradient =0.0141236
Iteration 26
No of NaNs in logZs: 0, No infs: 0
dual is 1.85947
regularized dual is 1.99986
norm of gradient =0.0197912
norm of regularized gradient =0.014258
Iteration 27
No of NaNs in logZs: 0, No infs: 0
dual is 1.85859
regularized dual is 1.99951
norm of gradient =0.0198709
norm of regularized gradient =0.0142521
Iteration 28
No of NaNs in logZs: 0, No infs: 0
dual is 1.85683
regularized dual is 1.99866
norm of gradient =0.0207602
norm of regularized gradient =0.0157125
Iteration 29
No of NaNs in logZs: 0, No infs: 0
dual is 1.85675
regularized dual is 1.99861
norm of gradient =0.019597
norm of regularized gradient =0.0139656
Iteration 30
No of NaNs in logZs: 0, No infs: 0
dual is 1.85668
regularized dual is 1.9986
norm of gradient =0.0197068
norm of regularized gradient =0.0140497
Iteration 31
No of NaNs in logZs: 0, No infs: 0
dual is 1.85674
regularized dual is 1.9987
norm of gradient =0.0196683
norm of regularized gradient =0.0139978
Iteration 32
No of NaNs in logZs: 0, No infs: 0
dual is 1.85709
regularized dual is 1.99924
norm of gradient =0.0198983
norm of regularized gradient =0.014353
Iteration 33
No of NaNs in logZs: 0, No infs: 0
dual is 1.85676
regularized dual is 1.99913
norm of gradient =0.0196602
norm of regularized gradient =0.0140289
Iteration 34
No of NaNs in logZs: 0, No infs: 0
dual is 1.85656
regularized dual is 1.99906
norm of gradient =0.0196105
norm of regularized gradient =0.0139592
Iteration 35
No of NaNs in logZs: 0, No infs: 0
dual is 1.85622
regularized dual is 1.99905
norm of gradient =0.019561
norm of regularized gradient =0.0139033
Iteration 36
No of NaNs in logZs: 0, No infs: 0
dual is 1.85632
regularized dual is 1.99923
norm of gradient =0.0195582
norm of regularized gradient =0.0139196
Iteration 37
No of NaNs in logZs: 0, No infs: 0
dual is 1.85641
regularized dual is 1.99941
norm of gradient =0.0207849
norm of regularized gradient =0.0154313
No of NaNs in logZs: 0, No infs: 0
dual is 1.85634
regularized dual is 1.99929
norm of gradient =0.0198557
norm of regularized gradient =0.0142442
Iteration 38
No of NaNs in logZs: 0, No infs: 0
dual is 1.85643
regularized dual is 1.9994
norm of gradient =0.0196162
norm of regularized gradient =0.0139561
Iteration 39
OWL-BFGS terminated with the stopping criterion
Duration: 0 seconds
ok
test_to_ngram_lm (test_maxent.TestMaxentLm) ... Starting fitting...
Starting OWL-BFGS with c1=0.000456204, sigma2=6576, max_iters=1000
No of NaNs in logZs: 0, No infs: 0
dual is 4.68213
regularized dual is 4.68213
norm of gradient =0.424182
norm of regularized gradient =0.424182
No of NaNs in logZs: 0, No infs: 0
dual is 4.26599
regularized dual is 4.26607
norm of gradient =0.405679
norm of regularized gradient =0.405527
Iteration 1
No of NaNs in logZs: 0, No infs: 0
dual is 12.6053
regularized dual is 12.6493
norm of gradient =0.702017
norm of regularized gradient =0.704752
No of NaNs in logZs: 0, No infs: 0
dual is 6.60097
regularized dual is 6.61289
norm of gradient =0.700588
norm of regularized gradient =0.702018
No of NaNs in logZs: 0, No infs: 0
dual is 3.77496
regularized dual is 3.77842
norm of gradient =0.540149
norm of regularized gradient =0.540885
Iteration 2
No of NaNs in logZs: 0, No infs: 0
dual is 3.20445
regularized dual is 3.20612
norm of gradient =0.142862
norm of regularized gradient =0.142163
Iteration 3
No of NaNs in logZs: 0, No infs: 0
dual is 3.10224
regularized dual is 3.10467
norm of gradient =0.0930172
norm of regularized gradient =0.0926131
Iteration 4
No of NaNs in logZs: 0, No infs: 0
dual is 3.00898
regularized dual is 3.01256
norm of gradient =0.099428
norm of regularized gradient =0.0990038
Iteration 5
No of NaNs in logZs: 0, No infs: 0
dual is 2.94199
regularized dual is 2.94677
norm of gradient =0.0660072
norm of regularized gradient =0.0657694
Iteration 6
No of NaNs in logZs: 0, No infs: 0
dual is 2.88191
regularized dual is 2.88783
norm of gradient =0.0590299
norm of regularized gradient =0.0590307
Iteration 7
No of NaNs in logZs: 0, No infs: 0
dual is 2.81161
regularized dual is 2.81963
norm of gradient =0.0470536
norm of regularized gradient =0.0467976
Iteration 8
No of NaNs in logZs: 0, No infs: 0
dual is 2.74549
regularized dual is 2.75595
norm of gradient =0.0400534
norm of regularized gradient =0.0395721
Iteration 9
No of NaNs in logZs: 0, No infs: 0
dual is 2.64902
regularized dual is 2.66465
norm of gradient =0.0348613
norm of regularized gradient =0.0342515
Iteration 10
No of NaNs in logZs: 0, No infs: 0
dual is 2.50365
regularized dual is 2.53153
norm of gradient =0.0706963
norm of regularized gradient =0.0704513
Iteration 11
No of NaNs in logZs: 0, No infs: 0
dual is 2.36064
regularized dual is 2.4049
norm of gradient =0.0920386
norm of regularized gradient =0.0911455
Iteration 12
No of NaNs in logZs: 0, No infs: 0
dual is 2.27304
regularized dual is 2.32685
norm of gradient =0.0343558
norm of regularized gradient =0.0323156
Iteration 13
No of NaNs in logZs: 0, No infs: 0
dual is 2.16259
regularized dual is 2.23523
norm of gradient =0.0279268
norm of regularized gradient =0.0254337
Iteration 14
No of NaNs in logZs: 0, No infs: 0
dual is 2.09053
regularized dual is 2.17633
norm of gradient =0.0421421
norm of regularized gradient =0.0403006
Iteration 15
No of NaNs in logZs: 0, No infs: 0
dual is 2.03505
regularized dual is 2.13228
norm of gradient =0.0271689
norm of regularized gradient =0.024379
Iteration 16
No of NaNs in logZs: 0, No infs: 0
dual is 2.01308
regularized dual is 2.11385
norm of gradient =0.021937
norm of regularized gradient =0.0180038
Iteration 17
No of NaNs in logZs: 0, No infs: 0
dual is 1.9581
regularized dual is 2.0703
norm of gradient =0.024164
norm of regularized gradient =0.020173
Iteration 18
No of NaNs in logZs: 0, No infs: 0
dual is 1.91613
regularized dual is 2.03855
norm of gradient =0.0230848
norm of regularized gradient =0.0186832
Iteration 19
No of NaNs in logZs: 0, No infs: 0
dual is 1.87709
regularized dual is 2.01744
norm of gradient =0.101709
norm of regularized gradient =0.101195
No of NaNs in logZs: 0, No infs: 0
dual is 1.88923
regularized dual is 2.01995
norm of gradient =0.0485505
norm of regularized gradient =0.0469903
Iteration 20
No of NaNs in logZs: 0, No infs: 0
dual is 1.87557
regularized dual is 2.00922
norm of gradient =0.0200276
norm of regularized gradient =0.0148839
Iteration 21
No of NaNs in logZs: 0, No infs: 0
dual is 1.87054
regularized dual is 2.00577
norm of gradient =0.019616
norm of regularized gradient =0.0141275
Iteration 22
No of NaNs in logZs: 0, No infs: 0
dual is 1.86262
regularized dual is 2.0008
norm of gradient =0.0195721
norm of regularized gradient =0.0139688
Iteration 23
No of NaNs in logZs: 0, No infs: 0
dual is 1.86826
regularized dual is 2.00589
norm of gradient =0.0233995
norm of regularized gradient =0.0190818
No of NaNs in logZs: 0, No infs: 0
dual is 1.86482
regularized dual is 2.00263
norm of gradient =0.0202747
norm of regularized gradient =0.0149986
Iteration 24
No of NaNs in logZs: 0, No infs: 0
dual is 1.86117
regularized dual is 2.00053
norm of gradient =0.0204487
norm of regularized gradient =0.0150996
Iteration 25
No of NaNs in logZs: 0, No infs: 0
dual is 1.86038
regularized dual is 2.00014
norm of gradient =0.0197198
norm of regularized gradient =0.0141236
Iteration 26
No of NaNs in logZs: 0, No infs: 0
dual is 1.85947
regularized dual is 1.99986
norm of gradient =0.0197912
norm of regularized gradient =0.014258
Iteration 27
No of NaNs in logZs: 0, No infs: 0
dual is 1.85859
regularized dual is 1.99951
norm of gradient =0.0198709
norm of regularized gradient =0.0142521
Iteration 28
No of NaNs in logZs: 0, No infs: 0
dual is 1.85683
regularized dual is 1.99866
norm of gradient =0.0207602
norm of regularized gradient =0.0157125
Iteration 29
No of NaNs in logZs: 0, No infs: 0
dual is 1.85675
regularized dual is 1.99861
norm of gradient =0.019597
norm of regularized gradient =0.0139656
Iteration 30
No of NaNs in logZs: 0, No infs: 0
dual is 1.85668
regularized dual is 1.9986
norm of gradient =0.0197068
norm of regularized gradient =0.0140497
Iteration 31
No of NaNs in logZs: 0, No infs: 0
dual is 1.85674
regularized dual is 1.9987
norm of gradient =0.0196683
norm of regularized gradient =0.0139978
Iteration 32
No of NaNs in logZs: 0, No infs: 0
dual is 1.85709
regularized dual is 1.99924
norm of gradient =0.0198983
norm of regularized gradient =0.014353
Iteration 33
No of NaNs in logZs: 0, No infs: 0
dual is 1.85676
regularized dual is 1.99913
norm of gradient =0.0196602
norm of regularized gradient =0.0140289
Iteration 34
No of NaNs in logZs: 0, No infs: 0
dual is 1.85656
regularized dual is 1.99906
norm of gradient =0.0196105
norm of regularized gradient =0.0139592
Iteration 35
No of NaNs in logZs: 0, No infs: 0
dual is 1.85622
regularized dual is 1.99905
norm of gradient =0.019561
norm of regularized gradient =0.0139033
Iteration 36
No of NaNs in logZs: 0, No infs: 0
dual is 1.85632
regularized dual is 1.99923
norm of gradient =0.0195582
norm of regularized gradient =0.0139196
Iteration 37
No of NaNs in logZs: 0, No infs: 0
dual is 1.85641
regularized dual is 1.99941
norm of gradient =0.0207849
norm of regularized gradient =0.0154313
No of NaNs in logZs: 0, No infs: 0
dual is 1.85634
regularized dual is 1.99929
norm of gradient =0.0198557
norm of regularized gradient =0.0142442
Iteration 38
No of NaNs in logZs: 0, No infs: 0
dual is 1.85643
regularized dual is 1.9994
norm of gradient =0.0196162
norm of regularized gradient =0.0139561
Iteration 39
OWL-BFGS terminated with the stopping criterion
Duration: 0 seconds
ok
test_train_test (test_maxent.TestMaxentLm) ... Starting fitting...
Starting OWL-BFGS with c1=0.000456204, sigma2=6576, max_iters=1000
No of NaNs in logZs: 0, No infs: 0
dual is 4.68213
regularized dual is 4.68213
norm of gradient =0.424182
norm of regularized gradient =0.424182
No of NaNs in logZs: 0, No infs: 0
dual is 4.26599
regularized dual is 4.26607
norm of gradient =0.405679
norm of regularized gradient =0.405527
Iteration 1
No of NaNs in logZs: 0, No infs: 0
dual is 12.6053
regularized dual is 12.6493
norm of gradient =0.702017
norm of regularized gradient =0.704752
No of NaNs in logZs: 0, No infs: 0
dual is 6.60097
regularized dual is 6.61289
norm of gradient =0.700588
norm of regularized gradient =0.702018
No of NaNs in logZs: 0, No infs: 0
dual is 3.77496
regularized dual is 3.77842
norm of gradient =0.540149
norm of regularized gradient =0.540885
Iteration 2
No of NaNs in logZs: 0, No infs: 0
dual is 3.20445
regularized dual is 3.20612
norm of gradient =0.142862
norm of regularized gradient =0.142163
Iteration 3
No of NaNs in logZs: 0, No infs: 0
dual is 3.10224
regularized dual is 3.10467
norm of gradient =0.0930172
norm of regularized gradient =0.0926131
Iteration 4
No of NaNs in logZs: 0, No infs: 0
dual is 3.00898
regularized dual is 3.01256
norm of gradient =0.099428
norm of regularized gradient =0.0990038
Iteration 5
No of NaNs in logZs: 0, No infs: 0
dual is 2.94199
regularized dual is 2.94677
norm of gradient =0.0660072
norm of regularized gradient =0.0657694
Iteration 6
No of NaNs in logZs: 0, No infs: 0
dual is 2.88191
regularized dual is 2.88783
norm of gradient =0.0590299
norm of regularized gradient =0.0590307
Iteration 7
No of NaNs in logZs: 0, No infs: 0
dual is 2.81161
regularized dual is 2.81963
norm of gradient =0.0470536
norm of regularized gradient =0.0467976
Iteration 8
No of NaNs in logZs: 0, No infs: 0
dual is 2.74549
regularized dual is 2.75595
norm of gradient =0.0400534
norm of regularized gradient =0.0395721
Iteration 9
No of NaNs in logZs: 0, No infs: 0
dual is 2.64902
regularized dual is 2.66465
norm of gradient =0.0348613
norm of regularized gradient =0.0342515
Iteration 10
No of NaNs in logZs: 0, No infs: 0
dual is 2.50365
regularized dual is 2.53153
norm of gradient =0.0706963
norm of regularized gradient =0.0704513
Iteration 11
No of NaNs in logZs: 0, No infs: 0
dual is 2.36064
regularized dual is 2.4049
norm of gradient =0.0920386
norm of regularized gradient =0.0911455
Iteration 12
No of NaNs in logZs: 0, No infs: 0
dual is 2.27304
regularized dual is 2.32685
norm of gradient =0.0343558
norm of regularized gradient =0.0323156
Iteration 13
No of NaNs in logZs: 0, No infs: 0
dual is 2.16259
regularized dual is 2.23523
norm of gradient =0.0279268
norm of regularized gradient =0.0254337
Iteration 14
No of NaNs in logZs: 0, No infs: 0
dual is 2.09053
regularized dual is 2.17633
norm of gradient =0.0421421
norm of regularized gradient =0.0403006
Iteration 15
No of NaNs in logZs: 0, No infs: 0
dual is 2.03505
regularized dual is 2.13228
norm of gradient =0.0271689
norm of regularized gradient =0.024379
Iteration 16
No of NaNs in logZs: 0, No infs: 0
dual is 2.01308
regularized dual is 2.11385
norm of gradient =0.021937
norm of regularized gradient =0.0180038
Iteration 17
No of NaNs in logZs: 0, No infs: 0
dual is 1.9581
regularized dual is 2.0703
norm of gradient =0.024164
norm of regularized gradient =0.020173
Iteration 18
No of NaNs in logZs: 0, No infs: 0
dual is 1.91613
regularized dual is 2.03855
norm of gradient =0.0230848
norm of regularized gradient =0.0186832
Iteration 19
No of NaNs in logZs: 0, No infs: 0
dual is 1.87709
regularized dual is 2.01744
norm of gradient =0.101709
norm of regularized gradient =0.101195
No of NaNs in logZs: 0, No infs: 0
dual is 1.88923
regularized dual is 2.01995
norm of gradient =0.0485505
norm of regularized gradient =0.0469903
Iteration 20
No of NaNs in logZs: 0, No infs: 0
dual is 1.87557
regularized dual is 2.00922
norm of gradient =0.0200276
norm of regularized gradient =0.0148839
Iteration 21
No of NaNs in logZs: 0, No infs: 0
dual is 1.87054
regularized dual is 2.00577
norm of gradient =0.019616
norm of regularized gradient =0.0141275
Iteration 22
No of NaNs in logZs: 0, No infs: 0
dual is 1.86262
regularized dual is 2.0008
norm of gradient =0.0195721
norm of regularized gradient =0.0139688
Iteration 23
No of NaNs in logZs: 0, No infs: 0
dual is 1.86826
regularized dual is 2.00589
norm of gradient =0.0233995
norm of regularized gradient =0.0190818
No of NaNs in logZs: 0, No infs: 0
dual is 1.86482
regularized dual is 2.00263
norm of gradient =0.0202747
norm of regularized gradient =0.0149986
Iteration 24
No of NaNs in logZs: 0, No infs: 0
dual is 1.86117
regularized dual is 2.00053
norm of gradient =0.0204487
norm of regularized gradient =0.0150996
Iteration 25
No of NaNs in logZs: 0, No infs: 0
dual is 1.86038
regularized dual is 2.00014
norm of gradient =0.0197198
norm of regularized gradient =0.0141236
Iteration 26
No of NaNs in logZs: 0, No infs: 0
dual is 1.85947
regularized dual is 1.99986
norm of gradient =0.0197912
norm of regularized gradient =0.014258
Iteration 27
No of NaNs in logZs: 0, No infs: 0
dual is 1.85859
regularized dual is 1.99951
norm of gradient =0.0198709
norm of regularized gradient =0.0142521
Iteration 28
No of NaNs in logZs: 0, No infs: 0
dual is 1.85683
regularized dual is 1.99866
norm of gradient =0.0207602
norm of regularized gradient =0.0157125
Iteration 29
No of NaNs in logZs: 0, No infs: 0
dual is 1.85675
regularized dual is 1.99861
norm of gradient =0.019597
norm of regularized gradient =0.0139656
Iteration 30
No of NaNs in logZs: 0, No infs: 0
dual is 1.85668
regularized dual is 1.9986
norm of gradient =0.0197068
norm of regularized gradient =0.0140497
Iteration 31
No of NaNs in logZs: 0, No infs: 0
dual is 1.85674
regularized dual is 1.9987
norm of gradient =0.0196683
norm of regularized gradient =0.0139978
Iteration 32
No of NaNs in logZs: 0, No infs: 0
dual is 1.85709
regularized dual is 1.99924
norm of gradient =0.0198983
norm of regularized gradient =0.014353
Iteration 33
No of NaNs in logZs: 0, No infs: 0
dual is 1.85676
regularized dual is 1.99913
norm of gradient =0.0196602
norm of regularized gradient =0.0140289
Iteration 34
No of NaNs in logZs: 0, No infs: 0
dual is 1.85656
regularized dual is 1.99906
norm of gradient =0.0196105
norm of regularized gradient =0.0139592
Iteration 35
No of NaNs in logZs: 0, No infs: 0
dual is 1.85622
regularized dual is 1.99905
norm of gradient =0.019561
norm of regularized gradient =0.0139033
Iteration 36
No of NaNs in logZs: 0, No infs: 0
dual is 1.85632
regularized dual is 1.99923
norm of gradient =0.0195582
norm of regularized gradient =0.0139196
Iteration 37
No of NaNs in logZs: 0, No infs: 0
dual is 1.85641
regularized dual is 1.99941
norm of gradient =0.0207849
norm of regularized gradient =0.0154313
No of NaNs in logZs: 0, No infs: 0
dual is 1.85634
regularized dual is 1.99929
norm of gradient =0.0198557
norm of regularized gradient =0.0142442
Iteration 38
No of NaNs in logZs: 0, No infs: 0
dual is 1.85643
regularized dual is 1.9994
norm of gradient =0.0196162
norm of regularized gradient =0.0139561
Iteration 39
OWL-BFGS terminated with the stopping criterion
Duration: 0 seconds
ok
test_length (test_ngram.TestNgramCacheLM) ... ok
test_prob (test_ngram.TestNgramCacheLM) ... ok
test_prob (test_ngram.TestNgramCountLM) ... iteration 0: log likelihood = -199.326
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 1: log likelihood = -186.778
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 2: log likelihood = -184.043
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 3: log likelihood = -183.032
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 4: log likelihood = -182.549
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 5: log likelihood = -182.276
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 6: log likelihood = -182.106
ok
test_read_write (test_ngram.TestNgramCountLM) ... ok
test_train (test_ngram.TestNgramCountLM) ... iteration 0: log likelihood = -199.326
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 1: log likelihood = -186.778
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 2: log likelihood = -184.043
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 3: log likelihood = -183.032
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 4: log likelihood = -182.549
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 5: log likelihood = -182.276
warning: no data to estimate mixture weight for count 0, order 1
warning: no data to estimate mixture weight for count 1, order 1
iteration 6: log likelihood = -182.106
ok
test_compare_with_command_line (test_ngram.TestNgramLM) ... ok
test_len (test_ngram.TestNgramLM) ... ok
test_order (test_ngram.TestNgramLM) ... ok
test_prob (test_ngram.TestNgramLM) ... ok
test_iter (test_ngram.TestNgramLMInDepth) ... ok
test_mix (test_ngram.TestNgramLMInDepth) ... ok
test_prune (test_ngram.TestNgramLMInDepth) ... ok
test_rand_gen (test_ngram.TestNgramLMInDepth) ... ok
test_read_write (test_ngram.TestNgramLMInDepth) ... ok
test_test (test_ngram.TestNgramLMInDepth) ... ok
test_train (test_ngram.TestNgramLMInDepth) ... ok
test_order (test_ngram.TestNgramSimpleClassLM) ... ok
test_train (test_ngram.TestNgramSimpleClassLM) ... one of required KneserNey count-of-counts is zero
ok
test_train_class (test_ngram.TestNgramSimpleClassLM) ... ok
test_add (test_stats.TestNgramStats) ... ok
test_count (test_stats.TestNgramStats) ... ok
test_count_file (test_stats.TestNgramStats) ... ok
test_count_string (test_stats.TestNgramStats) ... ok
test_get (test_stats.TestNgramStats) ... ok
test_iter (test_stats.TestNgramStats) ... ok
test_len (test_stats.TestNgramStats) ... ok
test_make_test (test_stats.TestNgramStats) ... ok
test_order (test_stats.TestNgramStats) ... ok
test_read_write (test_stats.TestNgramStats) ... ok
test_read_write_binary (test_stats.TestNgramStats) ... ok
test_remove (test_stats.TestNgramStats) ... ok
test_set (test_stats.TestNgramStats) ... ok
test_sum_counts (test_stats.TestNgramStats) ... ok
test_add (test_vocab.TestVocab) ... ok
test_delete (test_vocab.TestVocab) ... ok
test_get (test_vocab.TestVocab) ... ok
test_in (test_vocab.TestVocab) ... ok
test_index (test_vocab.TestVocab) ... ok
test_iter (test_vocab.TestVocab) ... ok
test_property (test_vocab.TestVocab) ... ok
test_string (test_vocab.TestVocab) ... ok
======================================================================
FAIL: test_prob (test_maxent.TestMaxentLm)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/think/pkg/srilm-1.7.3/srilm-python/tests/test_maxent.py", line 22, in test_prob
self.assertAlmostEqual(
AssertionError: -0.09901417791843414 != -1.2563170194625854 within 7 places (1.1573028415441513 difference)
----------------------------------------------------------------------
Ran 49 tests in 0.106s
FAILED (failures=1)
make: *** [Makefile:16: test] Error 1
It's a long long time since I used srilm, thanks for the python bindings.
All worked swimmingly, except the MaxentLm test failed. I don't need this, so I'm good, just thought I'd report it as others may well have the same. I'm
Ubuntu 22.04.1 LTS
,srilm-1.7.3
, everything done according to your instructions except I removed 'iconv' fromsetup.py
as I didn't have libiconv and didn't seem to need it.