Code from BasicOptimizer.scala:88 executed in 158.61 seconds (3.226 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: 2243312137106
Reset training subject: 2244541619015
Adding measurement 4e5e33a4 to history. Total: 0
LBFGS Accumulation History: 1 points
Constructing line search parameters: GD+Trust
th(0)=1.50718155503273;dx=-5.16260255306371E-7
New Minimum: 1.50718155503273 > 1.5071801841259003
WOLFE (weak): th(2.154434690031884)=1.5071801841259003; dx=-5.161807142109884E-7 evalInputDelta=1.3709068298339844E-6
New Minimum: 1.5071801841259003 > 1.5071787685155869
WOLFE (weak): th(4.308869380063768)=1.5071787685155869; dx=-5.161740345405875E-7 evalInputDelta=2.7865171432495117E-6
New Minimum: 1.5071787685155869 > 1.5071730613708496
WOLFE (weak): th(12.926608140191302)=1.5071730613708496; dx=-5.159812915320291E-7 evalInputDelta=8.493661880493164E-6
New Minimum: 1.5071730613708496 > 1.5071480870246887
WOLFE (weak): th(51.70643256076521)=1.5071480870246887; dx=-5.160905884220004E-7 evalInputDelta=3.3468008041381836E-5
New Minimum: 1.5071480870246887 > 1.5070141106843948
WOLFE (weak): th(258.53216280382605)=1.5070141106843948; dx=-5.161676595028443E-7 evalInputDelta=1.674443483352661E-4
New Minimum: 1.5070141106843948 > 1.5061771273612976
WOLFE (weak): th(1551.1929768229563)=1.5061771273612976; dx=-5.159394805664235E-7 evalInputDelta=0.0010044276714324951
New Minimum: 1.5061771273612976 > 1.500159740447998
WOLFE (weak): th(10858.350837760694)=1.500159740447998; dx=-5.146864007997142E-7 evalInputDelta=0.007021814584732056
New Minimum: 1.500159740447998 > 1.4515587985515594
WOLFE (weak): th(86866.80670208555)=1.4515587985515594; dx=-5.046370049714152E-7 evalInputDelta=0.055622756481170654
New Minimum: 1.4515587985515594 > 1.056441992521286
END: th(781801.26031877)=1.056441992521286; dx=-3.9962088432171244E-7 evalInputDelta=0.4507395625114441
Fitness changed from 1.50718155503273 to 1.056441992521286
Iteration 1 complete. Error: 1.056441992521286 Total: 15.5209; Orientation: 0.0057; Line Search: 11.9351
<a id="p-3"></a>Iteration 1
<a id="p-2"></a>
Addi
...skipping 24684 bytes...
b to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.641e+03, gradient 7.122e-05, dot -0.491; [8eca5cf6-7cab-473b-8a29-e971899e6d9e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.4579289257526398, 0.43476128578186035, 1.056441992521286, 1.50718155503273
LBFGS Accumulation History: 3 points
Removed measurement 48219d2b to history. Total: 3
th(0)=-1.4579289257526398;dx=-5.064018512139315E-9
New Minimum: -1.4579289257526398 > -1.4685273692011833
WOLF (strong): th(3917235.946577146)=-1.4685273692011833; dx=3.6963946876471085E-10 evalInputDelta=0.010598443448543549
END: th(1958617.973288573)=-1.4666737765073776; dx=-2.315642591172772E-9 evalInputDelta=0.008744850754737854
Fitness changed from -1.4579289257526398 to -1.4685273692011833
Iteration 29 complete. Error: -1.4685273692011833 Total: 4.9457; Orientation: 0.1983; Line Search: 3.6649
Adding measurement 6eb3de56 to history. Total: 3
Rejected: LBFGS Orientation magnitude: 1.680e+03, gradient 7.150e-05, dot -0.483; [8eca5cf6-7cab-473b-8a29-e971899e6d9e = 1.000/1.000e+00]
Orientation rejected. Popping history element from -1.4685273692011833, 0.43476128578186035, 1.056441992521286, 1.50718155503273
LBFGS Accumulation History: 3 points
Removed measurement 6eb3de56 to history. Total: 3
th(0)=-1.4685273692011833;dx=-5.095751991158479E-9
New Minimum: -1.4685273692011833 > -1.477458119392395
WOLF (strong): th(4219714.506172843)=-1.477458119392395; dx=1.096582127894015E-9 evalInputDelta=0.0089307501912117
New Minimum: -1.477458119392395 > -1.4774840325117111
END: th(2109857.2530864216)=-1.4774840325117111; dx=-1.7305194933035161E-9 evalInputDelta=0.008956663310527802
Fitness changed from -1.4685273692011833 to -1.4774840325117111
Iteration 30 complete. Error: -1.4774840325117111 Total: 4.7123; Orientation: 0.1863; Line Search: 3.2843
<a id="p-21"></a>Iteration 30
<a id="p-20"></a>
Final threshold in iteration 31: -1.4774840325117111 (> -Infinity) after 158.609s (< 3600.000s)
-1.4774840325117111