Code from BasicOptimizer.scala:88 executed in 159.32 seconds (4.182 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: 716152182581
Reset training subject: 717912146103
Adding measurement 422111c0 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=15.56628593057394;dx=-2.289040557366226E-6
New Minimum: 15.56628593057394 > 15.566279610618949
WOLFE (weak): th(2.154434690031884)=15.566279610618949; dx=-2.2879222493239192E-6 evalInputDelta=6.319954991340637E-6
New Minimum: 15.566279610618949 > 15.5662736389786
WOLFE (weak): th(4.308869380063768)=15.5662736389786; dx=-2.2877216206125304E-6 evalInputDelta=1.2291595339775085E-5
New Minimum: 15.5662736389786 > 15.56624955125153
WOLFE (weak): th(12.926608140191302)=15.56624955125153; dx=-2.288449882427048E-6 evalInputDelta=3.637932240962982E-5
New Minimum: 15.56624955125153 > 15.56614013388753
WOLFE (weak): th(51.70643256076521)=15.56614013388753; dx=-2.288140901131663E-6 evalInputDelta=1.4579668641090393E-4
New Minimum: 15.56614013388753 > 15.565556828863919
WOLFE (weak): th(258.53216280382605)=15.565556828863919; dx=-2.2901317695031353E-6 evalInputDelta=7.291017100214958E-4
New Minimum: 15.565556828863919 > 15.561908130533993
WOLFE (weak): th(1551.1929768229563)=15.561908130533993; dx=-2.294067777418128E-6 evalInputDelta=0.004377800039947033
New Minimum: 15.561908130533993 > 15.5354282874614
WOLFE (weak): th(10858.350837760694)=15.5354282874614; dx=-2.3249549547581687E-6 evalInputDelta=0.030857643112540245
New Minimum: 15.5354282874614 > 15.309996720403433
WOLFE (weak): th(86866.80670208555)=15.309996720403433; dx=-2.460451029967634E-6 evalInputDelta=0.25628921017050743
New Minimum: 15.309996720403433 > 13.420375928282738
END: th(781801.26031877)=13.420375928282738; dx=-1.8725558703264061E-6 evalInputDelta=2.1459100022912025
Fitness changed from 15.56628593057394 to 13.420375928282738
Iteration 1 complete. Error: 13.420375928282738 Total: 16.1874; Orientation: 0.0500; Line Search: 12.1424
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>![Iteration 1](etc/fdf63caf-6559-4279-9ade-e0cad4e420ed.jpg)
Adding measu
...skipping 25028 bytes...
istory. Total: 3
Rejected: LBFGS Orientation magnitude: 6.755e+02, gradient 7.789e-05, dot -0.297; [8543df48-875e-457a-b558-9c8a535b2b9f = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.2663844227790833, 9.268177777528763, 13.420375928282738, 15.56628593057394
LBFGS Accumulation History: 3 points
Removed measurement 625a4f7 to history. Total: 3
th(0)=-1.2663844227790833;dx=-6.046508273520251E-9
New Minimum: -1.2663844227790833 > -1.2782318890094757
END: th(2937926.9599328605)=-1.2782318890094757; dx=-6.826281224224884E-10 evalInputDelta=0.011847466230392456
Fitness changed from -1.2663844227790833 to -1.2782318890094757
Iteration 29 complete. Error: -1.2782318890094757 Total: 3.9240; Orientation: 0.2252; Line Search: 2.4406
Adding measurement 5ff2dfd1 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 6.588e+02, gradient 8.037e-05, dot -0.307; [8543df48-875e-457a-b558-9c8a535b2b9f = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.2782318890094757, 9.268177777528763, 13.420375928282738, 15.56628593057394
LBFGS Accumulation History: 3 points
Removed measurement 5ff2dfd1 to history. Total: 3
th(0)=-1.2782318890094757;dx=-6.449071463332088E-9
New Minimum: -1.2782318890094757 > -1.2821088582277298
WOLF (strong): th(6329571.759259267)=-1.2821088582277298; dx=1.3221046376743058E-9 evalInputDelta=0.0038769692182540894
New Minimum: -1.2821088582277298 > -1.2873328998684883
WOLF (strong): th(3164785.8796296334)=-1.2873328998684883; dx=8.380894781448353E-10 evalInputDelta=0.009101010859012604
END: th(1054928.626543211)=-1.2849022448062897; dx=-3.978692195805048E-9 evalInputDelta=0.006670355796813965
Fitness changed from -1.2782318890094757 to -1.2873328998684883
Iteration 30 complete. Error: -1.2873328998684883 Total: 6.0781; Orientation: 0.1395; Line Search: 4.7050
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>![Iteration 30](etc/59415d7a-83fc-44a3-b8e5-61e25f4ab1e2.jpg)
Final threshold in iteration 31: -1.2873328998684883 (> -Infinity) after 159.304s (< 3600.000s)
-1.2873328998684883