BasicOptimizer.scala:89 executed in 131.13 seconds (1.827 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: 115758866159500
Reset training subject: 115761756086100
Adding measurement 7c52eb5c to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-31.795361966040236;dx=-1.3747044330738986E-6
New Minimum: -31.795361966040236 > -31.795364625692702
END: th(2.154434690031884)=-31.795364625692702; dx=-1.0227382411486722E-6 evalInputDelta=2.659652466263651E-6
Fitness changed from -31.795361966040236 to -31.795364625692702
Iteration 1 complete. Error: -31.795364625692702 Total: 13.3320; Orientation: 0.0632; Line Search: 5.0471
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 332acd01 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-31.795364625692702;dx=-1.0216843780515985E-6
New Minimum: -31.795364625692702 > -31.795369944996967
WOLFE (weak): th(4.641588833612779)=-31.795369944996967; dx=-1.0210880333242357E-6 evalInputDelta=5.319304264617131E-6
New Minimum: -31.795369944996967 > -31.79537526430034
WOLFE (weak): th(9.283177667225559)=-31.79537526430034; dx=-1.0202812565138068E-6 evalInputDelta=1.0638607637503128E-5
New Minimum: -31.79537526430034 > -31.795395211680074
WOLFE (weak): th(27.849533001676676)=-31.795395211680074; dx=-1.0195126409484527E-6 evalInputDelta=3.058598737126772E-5
New Minimum: -31.795395211680074 > -31.795490958928582
WOLFE (weak): th(111.3981320067067)=-31.795490958928582; dx=-1.0190527653301275E-6 evalInputDelta=1.2633323587962764E-4
New Minimum: -31.795490958928582 > -31.795990967653093
WOLFE (weak): th(556.9906600335335)=-31.795990967653093; dx=-1.0188734171735673E-6 evalInputDelta=6.263419603911302E-4
New Minimum: -31.795990967653093 > -31.79912648140761
WOLFE (weak): th(3341.9439602012008)=-31.79912648140761; dx=-1.0183844916614082E-6 evalInputDelta=0.0037618557149059484
New Minimum: -31.79912648140761 > -31.82168296179414
WOLFE (weak): th(23393.607721408407)=-31.82168296179414; dx=-1.0175919467311171E-6 evalInputDelta=0.0263183361014363
New Minimum: -31.82168296179414 > -32.004635541460914
WOLFE (weak): th(187148.86177126726)=-32.004635541460914; dx=-1.0039913849209405E-6 evalInputDelta=0.20927091576821155
New Minimum: -32.004635541460914 > -33.55672394445135
END: th(1684339.7559414054)=-33.55672394445135; dx=-8.668740351391172E-7 evalInputDelta=1.7613593187586467
Fitness changed from -31.795364625692702 to -33.55672394445135
Iteration 2 complete. Error: -33.55672394445135 Total: 29.7074; Orientation: 0.0617; Line Search: 26.4212
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement a8bf9e1 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-33.55672394445135;dx=-8.893103407508646E-7
New Minimum: -33.55672394445135 > -36.374618508433876
END: th(3628800.0000000005)=-36.374618508433876; dx=-5.814953961071112E-7 evalInputDelta=2.8178945639825272
Fitness changed from -33.55672394445135 to -36.374618508433876
Iteration 3 complete. Error: -36.374618508433876 Total: 8.5888; Orientation: 0.0738; Line Search: 5.4704
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 192c788e to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.166e+04, gradient 7.660e-04, dot -0.801; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -36.374618508433876, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 192c788e to history. Total: 3
th(0)=-36.374618508433876;dx=-5.861842867620903E-7
New Minimum: -36.374618508433876 > -40.16921006734935
END: th(7818012.603187701)=-40.16921006734935; dx=-3.1709396168309937E-7 evalInputDelta=3.794591558915471
Fitness changed from -36.374618508433876 to -40.16921006734935
Iteration 4 complete. Error: -40.16921006734935 Total: 9.6936; Orientation: 1.0809; Line Search: 5.3479
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement f446af6 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.046e+04, gradient 6.819e-04, dot -0.593; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -40.16921006734935, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement f446af6 to history. Total: 3
th(0)=-40.16921006734935;dx=-4.6493792704464576E-7
New Minimum: -40.16921006734935 > -44.277051323117384
END: th(1.6843397559414055E7)=-44.277051323117384; dx=-1.1260840780193995E-7 evalInputDelta=4.107841255768037
Fitness changed from -40.16921006734935 to -44.277051323117384
Iteration 5 complete. Error: -44.277051323117384 Total: 9.5889; Orientation: 1.0741; Line Search: 5.3979
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 2169a91b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.107e+04, gradient 7.366e-04, dot -0.358; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -44.277051323117384, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 2169a91b to history. Total: 3
th(0)=-44.277051323117384;dx=-5.414963376722039E-7
New Minimum: -44.277051323117384 > -46.36018284408942
WOLF (strong): th(3.628800000000001E7)=-46.36018284408942; dx=5.153331363292624E-8 evalInputDelta=2.0831315209720387
New Minimum: -46.36018284408942 > -47.48728790396846
WOLF (strong): th(1.8144000000000004E7)=-47.48728790396846; dx=2.813390147430127E-8 evalInputDelta=3.210236580851074
END: th(6048000.000000001)=-46.8472416784452; dx=-2.2966972164291078E-7 evalInputDelta=2.570190355327817
Fitness changed from -44.277051323117384 to -47.48728790396846
Iteration 6 complete. Error: -47.48728790396846 Total: 15.3566; Orientation: 1.1128; Line Search: 10.9925
Adding measurement 246dba65 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.276e+04, gradient 7.608e-04, dot -0.275; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -47.48728790396846, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 246dba65 to history. Total: 3
th(0)=-47.48728790396846;dx=-5.786149170486381E-7
New Minimum: -47.48728790396846 > -51.59977129165428
END: th(1.3030021005312836E7)=-51.59977129165428; dx=-1.1627389444256476E-8 evalInputDelta=4.1124833876858204
Fitness changed from -47.48728790396846 to -51.59977129165428
Iteration 7 complete. Error: -51.59977129165428 Total: 9.1513; Orientation: 1.0200; Line Search: 5.2895
Adding measurement 1f273e94 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.057e+04, gradient 6.344e-04, dot -0.398; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -51.59977129165428, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 1f273e94 to history. Total: 3
th(0)=-51.59977129165428;dx=-4.0130381731240344E-7
New Minimum: -51.59977129165428 > -52.79722291577848
WOLF (strong): th(2.8072329265690096E7)=-52.79722291577848; dx=9.182922615699509E-8 evalInputDelta=1.1974516241241986
New Minimum: -52.79722291577848 > -54.06654324440041
WOLF (strong): th(1.4036164632845048E7)=-54.06654324440041; dx=2.2229929793530976E-8 evalInputDelta=2.4667719527461287
END: th(4678721.544281683)=-53.24305686009138; dx=-2.3794002146171178E-7 evalInputDelta=1.6432855684371006
Fitness changed from -51.59977129165428 to -54.06654324440041
Iteration 8 complete. Error: -54.06654324440041 Total: 14.4962; Orientation: 1.0020; Line Search: 10.6906
Adding measurement 299b47dd to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.351e+04, gradient 6.509e-04, dot -0.371; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -54.06654324440041, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 299b47dd to history. Total: 3
th(0)=-54.06654324440041;dx=-4.2272563790042453E-7
New Minimum: -54.06654324440041 > -56.3875713634244
END: th(1.0080000000000004E7)=-56.3875713634244; dx=-5.806942038159336E-9 evalInputDelta=2.3210281190239925
Fitness changed from -54.06654324440041 to -56.3875713634244
Iteration 9 complete. Error: -56.3875713634244 Total: 8.9615; Orientation: 1.0485; Line Search: 5.3190
Adding measurement 47e82680 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.927e+04, gradient 5.474e-04, dot -0.467; [b452c694-a23d-4499-8588-922ffbaa1d76 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -56.3875713634244, -33.55672394445135, -31.795364625692702, -31.795361966040236
LBFGS Accumulation History: 3 points
Removed measurement 47e82680 to history. Total: 3
th(0)=-56.3875713634244;dx=-2.988492698519091E-7
New Minimum: -56.3875713634244 > -57.50891053903582
WOLF (strong): th(2.1716701675521396E7)=-57.50891053903582; dx=5.8109510917853456E-8 evalInputDelta=1.1213391756114177
New Minimum: -57.50891053903582 > -58.04561539239927
END: th(1.0858350837760698E7)=-58.04561539239927; dx=-1.1946357377965753E-8 evalInputDelta=1.6580440289748708
Fitness changed from -56.3875713634244 to -58.04561539239927
Iteration 10 complete. Error: -58.04561539239927 Total: 11.7381; Orientation: 1.1697; Line Search: 8.0641
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -58.04561539239927 (> -Infinity) after 131.129s (< 5400.000s)
Returns
-58.04561539239927