BasicOptimizer.scala:89 executed in 140.94 seconds (1.863 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: 113338730397700
Reset training subject: 113341658833800
Adding measurement 93e4c39 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=-20.37176072284355;dx=-1.3174867270808551E-6
New Minimum: -20.37176072284355 > -20.371762798378732
END: th(2.154434690031884)=-20.371762798378732; dx=-1.114256760339753E-6 evalInputDelta=2.0755351819445877E-6
Fitness changed from -20.37176072284355 to -20.371762798378732
Iteration 1 complete. Error: -20.371762798378732 Total: 15.6195; Orientation: 0.0641; Line Search: 7.2001
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Adding measurement 5568c5c5 to history. Total: 1
LBFGS Accumulation History: 2 points
th(0)=-20.371762798378732;dx=-1.1136548983129127E-6
New Minimum: -20.371762798378732 > -20.371766949448457
WOLFE (weak): th(4.641588833612779)=-20.371766949448457; dx=-1.1131604014459002E-6 evalInputDelta=4.151069724400713E-6
New Minimum: -20.371766949448457 > -20.371774213818437
WOLFE (weak): th(9.283177667225559)=-20.371774213818437; dx=-1.1129810419729824E-6 evalInputDelta=1.1415439704620667E-5
New Minimum: -20.371774213818437 > -20.37179600691284
WOLFE (weak): th(27.849533001676676)=-20.37179600691284; dx=-1.1124446807836895E-6 evalInputDelta=3.320853410926361E-5
New Minimum: -20.37179600691284 > -20.371898745472453
WOLFE (weak): th(111.3981320067067)=-20.371898745472453; dx=-1.112119983224094E-6 evalInputDelta=1.3594709372100056E-4
New Minimum: -20.371898745472453 > -20.372437336110252
WOLFE (weak): th(556.9906600335335)=-20.372437336110252; dx=-1.1120911091855224E-6 evalInputDelta=6.745377315198198E-4
New Minimum: -20.372437336110252 > -20.3758107273724
WOLFE (weak): th(3341.9439602012008)=-20.3758107273724; dx=-1.111537216335089E-6 evalInputDelta=0.004047928993667682
New Minimum: -20.3758107273724 > -20.400090760686766
WOLFE (weak): th(23393.607721408407)=-20.400090760686766; dx=-1.1107565143017043E-6 evalInputDelta=0.02832796230803325
New Minimum: -20.400090760686766 > -20.597456786763612
WOLFE (weak): th(187148.86177126726)=-20.597456786763612; dx=-1.1008349757321097E-6 evalInputDelta=0.22569398838487942
New Minimum: -20.597456786763612 > -22.286188709007984
END: th(1684339.7559414054)=-22.286188709007984; dx=-9.6332169800781E-7 evalInputDelta=1.9144259106292516
Fitness changed from -20.371762798378732 to -22.286188709007984
Iteration 2 complete. Error: -22.286188709007984 Total: 30.0911; Orientation: 0.0558; Line Search: 26.9089
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>
Adding measurement 244e4bbb to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-22.286188709007984;dx=-9.93147572294754E-7
New Minimum: -22.286188709007984 > -25.523210273102343
END: th(3628800.0000000005)=-25.523210273102343; dx=-6.671231577534881E-7 evalInputDelta=3.237021564094359
Fitness changed from -22.286188709007984 to -25.523210273102343
Iteration 3 complete. Error: -25.523210273102343 Total: 8.9255; Orientation: 0.0549; Line Search: 5.5654
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>
Adding measurement 155b5cf6 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.476e+04, gradient 8.444e-04, dot -0.768; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -25.523210273102343, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 155b5cf6 to history. Total: 3
th(0)=-25.523210273102343;dx=-7.118236323746651E-7
New Minimum: -25.523210273102343 > -29.943365544752197
END: th(7818012.603187701)=-29.943365544752197; dx=-3.556801716437588E-7 evalInputDelta=4.420155271649854
Fitness changed from -25.523210273102343 to -29.943365544752197
Iteration 4 complete. Error: -29.943365544752197 Total: 11.7547; Orientation: 1.2360; Line Search: 7.0048
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>
Adding measurement 46df9632 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.468e+04, gradient 7.428e-04, dot -0.542; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -29.943365544752197, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 46df9632 to history. Total: 3
th(0)=-29.943365544752197;dx=-5.506766203160553E-7
New Minimum: -29.943365544752197 > -34.76382950523875
END: th(1.6843397559414055E7)=-34.76382950523875; dx=-1.2317782277072545E-7 evalInputDelta=4.820463960486556
Fitness changed from -29.943365544752197 to -34.76382950523875
Iteration 5 complete. Error: -34.76382950523875 Total: 9.4944; Orientation: 1.0675; Line Search: 5.3791
<a id="p-11"></a>Iteration 5
<a id="p-10"></a>
Adding measurement 665e8ebf to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.474e+04, gradient 7.716e-04, dot -0.332; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -34.76382950523875, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 665e8ebf to history. Total: 3
th(0)=-34.76382950523875;dx=-5.949933286012599E-7
New Minimum: -34.76382950523875 > -37.536406496650905
WOLF (strong): th(3.628800000000001E7)=-37.536406496650905; dx=4.747225478679482E-8 evalInputDelta=2.7725769914121514
New Minimum: -37.536406496650905 > -38.50008280873182
WOLF (strong): th(1.8144000000000004E7)=-38.50008280873182; dx=1.8029861573928305E-8 evalInputDelta=3.736253303493065
END: th(6048000.000000001)=-37.58710462213647; dx=-2.6178609168580554E-7 evalInputDelta=2.823275116897719
Fitness changed from -34.76382950523875 to -38.50008280873182
Iteration 6 complete. Error: -38.50008280873182 Total: 15.9452; Orientation: 1.2688; Line Search: 11.1996
Adding measurement 4ee141a4 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.623e+04, gradient 7.932e-04, dot -0.259; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -38.50008280873182, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 4ee141a4 to history. Total: 3
th(0)=-38.50008280873182;dx=-6.285903258806778E-7
New Minimum: -38.50008280873182 > -42.91512459112681
END: th(1.3030021005312836E7)=-42.91512459112681; dx=-1.6625714715027856E-8 evalInputDelta=4.415041782394994
Fitness changed from -38.50008280873182 to -42.91512459112681
Iteration 7 complete. Error: -42.91512459112681 Total: 11.1544; Orientation: 1.1746; Line Search: 7.3085
Adding measurement 1b14a141 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.523e+04, gradient 6.616e-04, dot -0.365; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -42.91512459112681, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 1b14a141 to history. Total: 3
th(0)=-42.91512459112681;dx=-4.371785471241359E-7
New Minimum: -42.91512459112681 > -44.56660752959652
WOLF (strong): th(2.8072329265690096E7)=-44.56660752959652; dx=8.87628908443512E-8 evalInputDelta=1.6514829384697052
New Minimum: -44.56660752959652 > -45.734480444806856
WOLF (strong): th(1.4036164632845048E7)=-45.734480444806856; dx=1.0074055023603641E-8 evalInputDelta=2.819355853680044
END: th(4678721.544281683)=-44.72172101387146; dx=-2.6503722687939113E-7 evalInputDelta=1.8065964227446472
Fitness changed from -42.91512459112681 to -45.734480444806856
Iteration 8 complete. Error: -45.734480444806856 Total: 15.4186; Orientation: 1.2087; Line Search: 11.4726
Adding measurement 5743c70b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 2.926e+04, gradient 6.669e-04, dot -0.353; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -45.734480444806856, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 5743c70b to history. Total: 3
th(0)=-45.734480444806856;dx=-4.446639331030047E-7
New Minimum: -45.734480444806856 > -48.330934010518746
END: th(1.0080000000000004E7)=-48.330934010518746; dx=-3.156460734355914E-8 evalInputDelta=2.59645356571189
Fitness changed from -45.734480444806856 to -48.330934010518746
Iteration 9 complete. Error: -48.330934010518746 Total: 9.6527; Orientation: 1.2108; Line Search: 5.4280
Adding measurement 59f0f607 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 3.639e+04, gradient 5.560e-04, dot -0.447; [07da96c8-8af6-4db1-9c87-7695f3285283 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -48.330934010518746, -22.286188709007984, -20.371762798378732, -20.37176072284355
LBFGS Accumulation History: 3 points
Removed measurement 59f0f607 to history. Total: 3
th(0)=-48.330934010518746;dx=-3.0846384413389216E-7
New Minimum: -48.330934010518746 > -49.99581378790975
WOLF (strong): th(2.1716701675521396E7)=-49.99581378790975; dx=3.71457321315819E-8 evalInputDelta=1.6648797773910076
New Minimum: -49.99581378790975 > -50.21624097863936
END: th(1.0858350837760698E7)=-50.21624097863936; dx=-3.909368820522079E-8 evalInputDelta=1.8853069681206165
Fitness changed from -48.330934010518746 to -50.21624097863936
Iteration 10 complete. Error: -50.21624097863936 Total: 12.3630; Orientation: 1.1724; Line Search: 8.5676
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>
Final threshold in iteration 11: -50.21624097863936 (> -Infinity) after 140.942s (< 5400.000s)
Returns
-50.21624097863936