BasicOptimizer.scala:89 executed in 12.73 seconds (0.996 gc):
val lineSearchInstance: LineSearchStrategy = lineSearchFactory
val trainer = new IterativeTrainer(trainable)
trainer.setOrientation(orientation())
trainer.setMonitor(new TrainingMonitor() {
override def clear(): Unit = trainingMonitor.clear()
override def log(msg: String): Unit = {
trainingMonitor.log(msg)
BasicOptimizer.this.log(msg)
}
override def onStepFail(currentPoint: Step): Boolean = {
BasicOptimizer.this.onStepFail(trainable.addRef().asInstanceOf[Trainable], currentPoint)
}
override def onStepComplete(currentPoint: Step): Unit = {
if (0 < logEvery && (0 == currentPoint.iteration % logEvery || currentPoint.iteration < logEvery)) {
val image = currentImage()
timelineAnimation += image
val caption = "Iteration " + currentPoint.iteration
out.p(caption + "\n" + out.jpg(image, caption))
}
BasicOptimizer.this.onStepComplete(trainable.addRef().asInstanceOf[Trainable], currentPoint)
trainingMonitor.onStepComplete(currentPoint)
super.onStepComplete(currentPoint)
}
})
trainer.setTimeout(trainingMinutes, TimeUnit.MINUTES)
trainer.setMaxIterations(trainingIterations)
trainer.setLineSearchFactory((_: CharSequence) => lineSearchInstance)
trainer.setTerminateThreshold(java.lang.Double.NEGATIVE_INFINITY)
val result = trainer.run.asInstanceOf[lang.Double]
trainer.freeRef()
result
Reset training subject: 138360593559700
Reset training subject: 138360722604200
Adding measurement 32b51378 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-2.5130664775175293;dx=-0.0026659678004601526
New Minimum: -2.5130664775175293 > -2.522860245476706
END: th(2.154434690031884)=-2.522860245476706; dx=-0.0022043584765129446 evalInputDelta=0.009793767959176858
Fitness changed from -2.5130664775175293 to -2.522860245476706
Iteration 1 complete. Error: -2.522860245476706 Total: 0.5802; Orientation: 0.0016; Line Search: 0.2292
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/3802b1ab-3250-400d-84be-a42bc5fd15b0.jpg)
Adding measurement 7d0d5f90 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-2.522860245476706;dx=-0.0031460212054867254
New Minimum: -2.522860245476706 > -2.546264200746828
WOLFE (weak): th(4.641588833612779)=-2.546264200746828; dx=-0.002917208180421374 evalInputDelta=0.023403955270121735
New Minimum: -2.546264200746828 > -2.569302160315796
END: th(9.283177667225559)=-2.569302160315796; dx=-0.0028111718813682686 evalInputDelta=0.04644191483908999
Fitness changed from -2.522860245476706 to -2.569302160315796
Iteration 2 complete. Error: -2.569302160315796 Total: 0.4582; Orientation: 0.0016; Line Search: 0.3392
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/aa959709-d6fc-4374-8c27-59d54155140b.jpg)
Adding measurement 2103dcc to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-2.569302160315796;dx=-0.0025406873206020846
New Minimum: -2.569302160315796 > -2.6755045726881765
WOLFE (weak): th(20.000000000000004)=-2.6755045726881765; dx=-0.0023455368379256365 evalInputDelta=0.10620241237238037
New Minimum: -2.6755045726881765 > -2.7790989647835125
WOLFE (weak): th(40.00000000000001)=-2.7790989647835125; dx=-0.002900861508103203 evalInputDelta=0.2097968044677163
New Minimum: -2.7790989647835125 > -3.2011535532289135
WOLFE (weak): th(120.00000000000003)=-3.2011535532289135; dx=-0.002973914850154624 evalInputDelta=0.6318513929131173
New Minimum: -3.2011535532289135 > -5.1992680914849725
WOLFE (weak): th(480.0000000000001)=-5.1992680914849725; dx=-0.002752296716199822 evalInputDelta=2.6299659311691763
New Minimum: -5.1992680914849725 > -13.877528604578643
END: th(2400.0000000000005)=-13.877528604578643; dx=-0.0022367770821784616 evalInputDelta=11.308226444262846
Fitness changed from -2.569302160315796 to -13.877528604578643
Iteration 3 complete. Error: -13.877528604578643 Total: 0.8062; Orientation: 0.0017; Line Search: 0.6857
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/980a79fd-4df5-4ae6-ab84-e40064426a50.jpg)
Adding measurement 1993c483 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.485e+03, gradient 8.645e-02, dot -0.477; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -13.877528604578643, -2.569302160315796, -2.522860245476706, -2.5130664775175293
LBFGS Accumulation History: 3 points
Removed measurement 1993c483 to history. Total: 3
th(0)=-13.877528604578643;dx=-0.005450212689432897
New Minimum: -13.877528604578643 > -37.59115386141815
END: th(5170.643256076522)=-37.59115386141815; dx=-0.0015538214317916787 evalInputDelta=23.713625256839507
Fitness changed from -13.877528604578643 to -37.59115386141815
Iteration 4 complete. Error: -37.59115386141815 Total: 0.3759; Orientation: 0.0276; Line Search: 0.2250
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/402b2e79-9756-4f13-8f83-f84a9998a200.jpg)
Adding measurement 2006482b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.130e+03, gradient 9.118e-02, dot -0.208; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -37.59115386141815, -2.569302160315796, -2.522860245476706, -2.5130664775175293
LBFGS Accumulation History: 3 points
Removed measurement 2006482b to history. Total: 3
th(0)=-37.59115386141815;dx=-0.007050010767729023
New Minimum: -37.59115386141815 > -65.09334868455264
END: th(11139.813200670673)=-65.09334868455264; dx=-2.7997506204339154E-4 evalInputDelta=27.502194823134488
Fitness changed from -37.59115386141815 to -65.09334868455264
Iteration 5 complete. Error: -65.09334868455264 Total: 0.3753; Orientation: 0.0286; Line Search: 0.2277
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>![Iteration 5](etc/db6fbc53-df84-45a6-8f70-2204d672cfcb.jpg)
Adding measurement 7fd3dc12 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.263e+03, gradient 1.208e-01, dot -0.164; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -65.09334868455264, -2.569302160315796, -2.522860245476706, -2.5130664775175293
LBFGS Accumulation History: 3 points
Removed measurement 7fd3dc12 to history. Total: 3
th(0)=-65.09334868455264;dx=-0.013758731422626055
New Minimum: -65.09334868455264 > -84.58541183047612
WOLF (strong): th(24000.000000000007)=-84.58541183047612; dx=1.9929444919856531E-4 evalInputDelta=19.49206314592348
New Minimum: -84.58541183047612 > -141.74672064107867
END: th(12000.000000000004)=-141.74672064107867; dx=-5.166292493801937E-4 evalInputDelta=76.65337195652603
Fitness changed from -65.09334868455264 to -141.74672064107867
Iteration 6 complete. Error: -141.74672064107867 Total: 0.4889; Orientation: 0.0279; Line Search: 0.3371
Adding measurement 73c9454 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.889e+04, gradient 2.127e-01, dot -0.080; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -141.74672064107867, -2.569302160315796, -2.522860245476706, -2.5130664775175293
LBFGS Accumulation History: 3 points
Removed measurement 73c9454 to history. Total: 3
th(0)=-141.74672064107867;dx=-0.042795134545463374
Armijo: th(25853.216280382614)=-125.35645659852348; dx=-1.7883570996315605E-4 evalInputDelta=-16.390264042555188
New Minimum: -141.74672064107867 > -165.60555900052088
WOLF (strong): th(12926.608140191307)=-165.60555900052088; dx=1.3141458352967114E-5 evalInputDelta=23.858838359442217
New Minimum: -165.60555900052088 > -266.30376511138553
END: th(4308.869380063769)=-266.30376511138553; dx=-0.004217307545264086 evalInputDelta=124.55704447030686
Fitness changed from -141.74672064107867 to -266.30376511138553
Iteration 7 complete. Error: -266.30376511138553 Total: 0.5969; Orientation: 0.0269; Line Search: 0.4580
Adding measurement 94d15da to history. Total: 3
Accepted: LBFGS Orientation magnitude: 4.495e+03, gradient 3.797e-01, dot 0.091; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
Constructing line search parameters: LBFGS+Trust
th(0)=-266.30376511138553;dx=-140.26206277586215
Armijo: th(9283.177667225562)=-21.17378984076075; dx=0.0011273057642899465 evalInputDelta=-245.12997527062478
Armijo: th(4641.588833612781)=-20.691233318255073; dx=0.002535331574943551 evalInputDelta=-245.61253179313047
Armijo: th(1547.196277870927)=-19.017239429207713; dx=0.005601527399400869 evalInputDelta=-247.28652568217782
Armijo: th(386.7990694677317)=-18.347977679082494; dx=0.030914268576397053 evalInputDelta=-247.95578743230303
Armijo: th(77.35981389354635)=-23.70316491221096; dx=0.18589036364317651 evalInputDelta=-242.60060019917458
Armijo: th(12.893302315591058)=-28.468067148437893; dx=1.2305873262626899 evalInputDelta=-237.83569796294765
Armijo: th(1.8419003307987225)=-198.3254408005942; dx=-1.8832953261604746 evalInputDelta=-67.97832431079132
New Minimum: -266.30376511138553 > -286.9522499476176
END: th(0.2302375413498403)=-286.9522499476176; dx=-44.785305607212834 evalInputDelta=20.648484836232058
Fitness changed from -266.30376511138553 to -286.9522499476176
Iteration 8 complete. Error: -286.9522499476176 Total: 1.1823; Orientation: 0.0273; Line Search: 1.0477
Adding measurement 68855ffe to history. Total: 4
Accepted: LBFGS Orientation magnitude: 2.254e+03, gradient 3.174e-01, dot 0.054; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
th(0)=-286.9522499476176;dx=-39.98529856260064
Armijo: th(0.49603174603174627)=-286.0530026280095; dx=-18.593754756556272 evalInputDelta=-0.8992473196080937
New Minimum: -286.9522499476176 > -287.8782973106865
END: th(0.24801587301587313)=-287.8782973106865; dx=-16.87695871724072 evalInputDelta=0.9260473630689035
Fitness changed from -286.9522499476176 to -287.8782973106865
Iteration 9 complete. Error: -287.8782973106865 Total: 0.4856; Orientation: 0.0343; Line Search: 0.3388
Adding measurement 72c5bce0 to history. Total: 5
Accepted: LBFGS Orientation magnitude: 2.240e+03, gradient 2.963e-01, dot 0.054; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
th(0)=-287.8782973106865;dx=-36.48864573451254
Armijo: th(0.5343340005039396)=-280.76449762211746; dx=-13.965771624017101 evalInputDelta=-7.113799688569031
Armijo: th(0.2671670002519698)=-285.9746765449696; dx=-18.714974170436264 evalInputDelta=-1.9036207657168802
Armijo: th(0.08905566675065661)=-287.4726481554376; dx=-12.654020315854313 evalInputDelta=-0.4056491552489092
Armijo: th(0.022263916687664153)=-287.7925821012418; dx=-14.137067661419893 evalInputDelta=-0.08571520944468602
Armijo: th(0.004452783337532831)=-287.85479466651236; dx=-16.604174272548573 evalInputDelta=-0.023502644174129728
Armijo: th(7.421305562554718E-4)=-287.874267259163; dx=-16.079494649270767 evalInputDelta=-0.004030051523500333
Armijo: th(1.0601865089363883E-4)=-287.87768670044574; dx=-15.916590714244858 evalInputDelta=-6.106102407557046E-4
Armijo: th(1.3252331361704854E-5)=-287.87820232695634; dx=-15.676303908154852 evalInputDelta=-9.498373015048855E-5
Armijo: th(1.4724812624116505E-6)=-287.8782566033774; dx=-13.422518804082511 evalInputDelta=-4.070730909688791E-5
Armijo: th(1.4724812624116505E-7)=-287.8782837415841; dx=-20.32776245016265 evalInputDelta=-1.3569102407018363E-5
Armijo: th(1.3386193294651368E-8)=-287.8782973106865; dx=-18.492223042646238 evalInputDelta=0.0
New Minimum: -287.8782973106865 > -287.8783244488893
END: th(1.115516107887614E-9)=-287.8783244488893; dx=-14.750559439383599 evalInputDelta=2.7138202824517066E-5
Fitness changed from -287.8782973106865 to -287.8783244488893
Iteration 10 complete. Error: -287.8783244488893 Total: 1.7056; Orientation: 0.0418; Line Search: 1.5515
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/88b28f01-05ba-4daa-9205-f96d5ea42f5a.jpg)
Adding measurement 5cde6de to history. Total: 6
Accepted: LBFGS Orientation magnitude: 2.195e+03, gradient 3.026e-01, dot 0.052; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
th(0)=-287.8783244488893;dx=-36.34501615782837
Armijo: th(2.403306600122425E-9)=-287.8782973106865; dx=-15.99016290967458 evalInputDelta=-2.7138202824517066E-5
New Minimum: -287.8783244488893 > -287.8783380179898
END: th(1.2016533000612125E-9)=-287.8783380179898; dx=-13.795984909053033 evalInputDelta=1.3569100474342122E-5
Fitness changed from -287.8783244488893 to -287.8783380179898
Iteration 11 complete. Error: -287.8783380179898 Total: 0.6764; Orientation: 0.0637; Line Search: 0.4532
Adding measurement 69e41c14 to history. Total: 7
Accepted: LBFGS Orientation magnitude: 1.966e+03, gradient 3.011e-01, dot 0.047; [720010f1-813e-49d0-8a19-c0e935d00209 = 1.000/1.000e+00]
th(0)=-287.8783380179898;dx=-33.16461171842124
Armijo: th(2.5888835550431686E-9)=-287.8783380179898; dx=-17.084152701505015 evalInputDelta=0.0
Armijo: th(1.2944417775215843E-9)=-287.8783380179898; dx=-15.73410052424296 evalInputDelta=0.0
END: th(4.3148059250719476E-10)=-287.8783380179898; dx=-16.022622011360696 evalInputDelta=0.0
Fitness changed from -287.8783380179898 to -287.8783380179898
Static Iteration Total: 0.7175; Orientation: 0.0660; Line Search: 0.5144
Iteration 12 failed. Error: -287.8783380179898
Previous Error: 0.0 -> -287.8783380179898
Retrying iteration 12
Reset training subject: 138369042630999
Adding measurement 528a638d to history. Total: 0
LBFGS Accumulation History: 1 points
th(0)=-287.8783380179898;dx=-0.08536924963935108
WOLFE (weak): th(9.295967565730117E-10)=-287.8783380179898; dx=-0.08398143538099458 evalInputDelta=0.0
WOLFE (weak): th(1.8591935131460235E-9)=-287.8783380179898; dx=-0.08500504713741927 evalInputDelta=0.0
WOLFE (weak): th(5.5775805394380706E-9)=-287.8783380179898; dx=-0.08460342979106884 evalInputDelta=0.0
WOLFE (weak): th(2.2310322157752282E-8)=-287.8783380179898; dx=-0.08456000057073194 evalInputDelta=0.0
WOLFE (weak): th(1.1155161078876141E-7)=-287.8783380179898; dx=-0.0845203629445486 evalInputDelta=0.0
Armijo: th(6.693096647325685E-7)=-287.8783380179898; dx=-0.08380568605974736 evalInputDelta=0.0
Armijo: th(3.90430637760665E-7)=-287.8783380179898; dx=-0.08356970010352159 evalInputDelta=0.0
WOLFE (weak): th(2.509911242747132E-7)=-287.8783380179898; dx=-0.08472846097238873 evalInputDelta=0.0
WOLFE (weak): th(3.207108810176891E-7)=-287.8783380179898; dx=-0.08357639123997998 evalInputDelta=0.0
Armijo: th(3.5557075938917707E-7)=-287.8783380179898; dx=-0.0833964257154398 evalInputDelta=0.0
Armijo: th(3.381408202034331E-7)=-287.8783380179898; dx=-0.0830475083304749 evalInputDelta=0.0
WOLFE (weak): th(3.294258506105611E-7)=-287.8783380179898; dx=-0.08367037681031891 evalInputDelta=0.0
Armijo: th(3.337833354069971E-7)=-287.8783380179898; dx=-0.08345949680165501 evalInputDelta=0.0
WOLFE (weak): th(3.316045930087791E-7)=-287.8783380179898; dx=-0.08437772855924326 evalInputDelta=0.0
WOLFE (weak): th(3.3269396420788807E-7)=-287.8783380179898; dx=-0.08271929274787387 evalInputDelta=0.0
Armijo: th(3.332386498074426E-7)=-287.8783380179898; dx=-0.0837908304122849 evalInputDelta=0.0
Armijo: th(3.329663070076653E-7)=-287.8783380179898; dx=-0.08321243976494704 evalInputDelta=0.0
WOLFE (weak): th(3.328301356077767E-7)=-287.8783380179898; dx=-0.08321299910943115 evalInputDelta=0.0
WOLFE (weak): th(3.32898221307721E-7)=-287.8783380179898; dx=-0.08503631787153391 evalInputDelta=0.0
Armijo: th(3.3293226415769314E-7)=-287.8783380179898; dx=-0.08406491036062294 evalInputDelta=0.0
WOLFE (weak): th(3.3291524273270705E-7)=-287.8783380179898; dx=-0.08218484179116503 evalInputDelta=0.0
WOLFE (weak): th(3.329237534452001E-7)=-287.8783380179898; dx=-0.08477503830921986 evalInputDelta=0.0
Armijo: th(3.329280088014466E-7)=-287.8783380179898; dx=-0.08451132841185682 evalInputDelta=0.0
WOLFE (weak): th(3.3292588112332333E-7)=-287.8783380179898; dx=-0.08296506235688741 evalInputDelta=0.0
mu ~= nu (3.3292588112332333E-7): th(0.0)=-287.8783380179898
Fitness changed from -287.8783380179898 to -287.8783380179898
Static Iteration Total: 4.2850; Orientation: 0.0017; Line Search: 4.0604
Iteration 13 failed. Error: -287.8783380179898
Previous Error: 0.0 -> -287.8783380179898
Optimization terminated 13
Final threshold in iteration 13: -287.8783380179898 (> -Infinity) after 12.734s (< 5400.000s)
Returns
-287.8783380179898