Code from BasicOptimizer.scala:88 executed in 1826.25 seconds (9.051 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: 2448899484964
Reset training subject: 2531098204948
Adding measurement 7cd352bc to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=0.5327540636062622;dx=-1.2670736296409358E-7
New Minimum: 0.5327540636062622 > 0.5327537655830383
WOLFE (weak): th(2.154434690031884)=0.5327537655830383; dx=-1.2717574678690055E-7 evalInputDelta=2.980232238769531E-7
New Minimum: 0.5327537655830383 > 0.5327533781528473
WOLFE (weak): th(4.308869380063768)=0.5327533781528473; dx=-1.2024319166948023E-7 evalInputDelta=6.854534149169922E-7
New Minimum: 0.5327533781528473 > 0.5327503383159637
WOLFE (weak): th(12.926608140191302)=0.5327503383159637; dx=-1.2116876062132238E-7 evalInputDelta=3.725290298461914E-6
New Minimum: 0.5327503383159637 > 0.5327399671077728
WOLFE (weak): th(51.70643256076521)=0.5327399671077728; dx=-1.202586142921137E-7 evalInputDelta=1.4096498489379883E-5
New Minimum: 0.5327399671077728 > 0.5326840281486511
WOLFE (weak): th(258.53216280382605)=0.5326840281486511; dx=-1.2650085082229624E-7 evalInputDelta=7.003545761108398E-5
New Minimum: 0.5326840281486511 > 0.5323340147733688
WOLFE (weak): th(1551.1929768229563)=0.5323340147733688; dx=-1.2020001958944133E-7 evalInputDelta=4.200488328933716E-4
New Minimum: 0.5323340147733688 > 0.5298126488924026
WOLFE (weak): th(10858.350837760694)=0.5298126488924026; dx=-1.2010188165637294E-7 evalInputDelta=0.002941414713859558
New Minimum: 0.5298126488924026 > 0.5092791020870209
WOLFE (weak): th(86866.80670208555)=0.5092791020870209; dx=-1.193127029494007E-7 evalInputDelta=0.023474961519241333
New Minimum: 0.5092791020870209 > 0.3280993402004242
WOLFE (weak): th(781801.26031877)=0.3280993402004242; dx=-1.1615179489839673E-7 evalInputDelta=0.204654723405838
New Minimum: 0.3280993402004242 > -0.8923544436693192
END: th(7818012.6031877)=-0.8923544436693192; dx=-5.324822431200409E-8 evalInputDelta=1.4251085072755814
Fitness changed from 0.5327540636062622 to -0.8923544436693192
Iteration 1 complete. Error: -
...skipping 268 bytes...
nts
th(0)=-0.8923544436693192;dx=-5.834673800374275E-8
New Minimum: -0.8923544436693192 > -2.303292602300644
END: th(1.684339755941405E7)=-2.303292602300644; dx=-2.9848418505952286E-8 evalInputDelta=1.4109381586313248
Fitness changed from -0.8923544436693192 to -2.303292602300644
Iteration 2 complete. Error: -2.303292602300644 Total: 237.2649; Orientation: 0.1030; Line Search: 154.5017
<a id="p-5"></a>Iteration 2
<a id="p-4"></a>![Iteration 2](etc/7ec7daa1-48fb-4774-8242-53f0ed81e065.jpg)
Adding measurement 2d7e8827 to history. Total: 2
LBFGS Accumulation History: 3 points
th(0)=-2.303292602300644;dx=-3.802332761145835E-8
New Minimum: -2.303292602300644 > -4.007221505045891
END: th(3.6288E7)=-4.007221505045891; dx=-1.644975208714142E-8 evalInputDelta=1.7039289027452469
Fitness changed from -2.303292602300644 to -4.007221505045891
Iteration 3 complete. Error: -4.007221505045891 Total: 237.7353; Orientation: 0.1022; Line Search: 157.3288
<a id="p-7"></a>Iteration 3
<a id="p-6"></a>![Iteration 3](etc/740be8fb-4f1c-4aab-a1ef-aaa54ddea2a8.jpg)
Adding measurement 57d10ca8 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.831e+04, gradient 1.733e-04, dot -0.677; [f3853b44-48d7-4456-b9dd-d26b9a704321 = 1.000/1.000e+00]
Orientation rejected. Popping history element from -4.007221505045891, -2.303292602300644, -0.8923544436693192, 0.5327540636062622
LBFGS Accumulation History: 3 points
Removed measurement 57d10ca8 to history. Total: 3
th(0)=-4.007221505045891;dx=-2.921919283086326E-8
New Minimum: -4.007221505045891 > -5.5485378205776215
END: th(7.8180126031877E7)=-5.5485378205776215; dx=-6.269382528241194E-9 evalInputDelta=1.5413163155317307
Fitness changed from -4.007221505045891 to -5.5485378205776215
Iteration 4 complete. Error: -5.5485378205776215 Total: 241.0482; Orientation: 2.5407; Line Search: 156.7773
<a id="p-9"></a>Iteration 4
<a id="p-8"></a>![Iteration 4](etc/2fd0dd0b-f5e0-468c-b26f-8ab9764733b8.jpg)
Final threshold in iteration 4: -5.5485378205776215 (> -Infinity) after 1826.249s (< 1800.000s)
-5.5485378205776215