Code from BasicOptimizer.scala:88 executed in 1593.43 seconds (6.956 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: 2920842525862
Reset training subject: 2954863660094
Adding measurement 35fb2225 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=2.718318909406662;dx=-2.0826758776632154E-7
New Minimum: 2.718318909406662 > 2.7183182537555695
WOLFE (weak): th(2.154434690031884)=2.7183182537555695; dx=-1.9838965610825718E-7 evalInputDelta=6.556510925292969E-7
New Minimum: 2.7183182537555695 > 2.7183170914649963
WOLFE (weak): th(4.308869380063768)=2.7183170914649963; dx=-2.087856790336197E-7 evalInputDelta=1.817941665649414E-6
New Minimum: 2.7183170914649963 > 2.718312755227089
WOLFE (weak): th(12.926608140191302)=2.718312755227089; dx=-2.0674218254027963E-7 evalInputDelta=6.154179573059082E-6
New Minimum: 2.718312755227089 > 2.718294769525528
WOLFE (weak): th(51.70643256076521)=2.718294769525528; dx=-1.9488908934000805E-7 evalInputDelta=2.4139881134033203E-5
New Minimum: 2.718294769525528 > 2.7181965857744217
WOLFE (weak): th(258.53216280382605)=2.7181965857744217; dx=-2.0769317943652845E-7 evalInputDelta=1.223236322402954E-4
New Minimum: 2.7181965857744217 > 2.7175875157117844
WOLFE (weak): th(1551.1929768229563)=2.7175875157117844; dx=-1.9805575934146877E-7 evalInputDelta=7.313936948776245E-4
New Minimum: 2.7175875157117844 > 2.7131996899843216
WOLFE (weak): th(10858.350837760694)=2.7131996899843216; dx=-2.0794903151146553E-7 evalInputDelta=0.005119219422340393
New Minimum: 2.7131996899843216 > 2.6775835901498795
WOLFE (weak): th(86866.80670208555)=2.6775835901498795; dx=-2.0387592017851338E-7 evalInputDelta=0.04073531925678253
New Minimum: 2.6775835901498795 > 2.3770508766174316
END: th(781801.26031877)=2.3770508766174316; dx=-1.748765513010258E-7 evalInputDelta=0.34126803278923035
Fitness changed from 2.718318909406662 to 2.3770508766174316
Iteration 1 complete. Error: 2.3770508766174316 Total: 447.4030; Orientation: 0.0253; Line Search: 344.1936
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/6305002a-9fb7-4983-9803-c26a9ea9409f
...skipping 5706 bytes...
ne Search: 105.3983
Adding measurement 25edc9bb to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.661e+03, gradient 2.210e-04, dot -0.271; [69343565-0354-4085-84a7-db4c86f9415b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.2749263346195221, 1.8263104856014252, 2.3770508766174316, 2.718318909406662
LBFGS Accumulation History: 3 points
Removed measurement 25edc9bb to history. Total: 3
th(0)=-0.2749263346195221;dx=-4.416306594937755E-8
Armijo: th(2.2680000000000004E7)=0.7644539475440979; dx=5.049289649301471E-9 evalInputDelta=-1.03938028216362
New Minimum: -0.2749263346195221 > -0.35720445215702057
END: th(1.1340000000000002E7)=-0.35720445215702057; dx=-2.177120924570219E-9 evalInputDelta=0.08227811753749847
Fitness changed from -0.2749263346195221 to -0.35720445215702057
Iteration 9 complete. Error: -0.35720445215702057 Total: 137.9446; Orientation: 0.6914; Line Search: 103.2081
Adding measurement 73cb5a56 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 5.638e+03, gradient 2.450e-04, dot -0.226; [69343565-0354-4085-84a7-db4c86f9415b = 1.000/1.000e+00]
Orientation rejected. Popping history element from -0.35720445215702057, 1.8263104856014252, 2.3770508766174316, 2.718318909406662
LBFGS Accumulation History: 3 points
Removed measurement 73cb5a56 to history. Total: 3
th(0)=-0.35720445215702057;dx=-5.461262292457263E-8
Armijo: th(2.4431289384961568E7)=0.803084135055542; dx=6.653433646607666E-9 evalInputDelta=-1.1602885872125626
New Minimum: -0.35720445215702057 > -0.4199957549571991
END: th(1.2215644692480784E7)=-0.4199957549571991; dx=-2.813296374583144E-10 evalInputDelta=0.06279130280017853
Fitness changed from -0.35720445215702057 to -0.4199957549571991
Iteration 10 complete. Error: -0.4199957549571991 Total: 138.6179; Orientation: 0.6397; Line Search: 103.7394
<a id="p-13"></a>Iteration 10
<a id="p-12"></a>![Iteration 10](etc/40674d24-bc55-49b4-81da-f91288355f73.jpg)
Final threshold in iteration 11: -0.4199957549571991 (> -Infinity) after 1593.432s (< 1800.000s)
-0.4199957549571991