Code from BasicOptimizer.scala:88 executed in 110.15 seconds (0.665 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

Logging:

    Reset training subject: 2814014752320
    Reset training subject: 2822114411231
    Adding measurement 66099461 to history. Total: 0
    LBFGS Accumulation History: 1 points
    Constructing line search parameters: GD+Trust
    th(0)=-3.822358970913688;dx=-1.5220758385295316E-8
    Armijo: th(2.154434690031884)=-3.822358970913688; dx=-1.369954635136269E-8 evalInputDelta=0.0
    Armijo: th(1.077217345015942)=-3.822358970913688; dx=-1.3685453681089219E-8 evalInputDelta=0.0
    Armijo: th(0.3590724483386473)=-3.822358970913688; dx=-1.3695873240341005E-8 evalInputDelta=0.0
    Armijo: th(0.08976811208466183)=-3.822358970913688; dx=-1.370714031954981E-8 evalInputDelta=0.0
    Armijo: th(0.017953622416932366)=-3.822358970913688; dx=-1.369653496549525E-8 evalInputDelta=0.0
    END: th(0.002992270402822061)=-3.822358970913688; dx=-1.3696426044516742E-8 evalInputDelta=0.0
    Fitness changed from -3.822358970913688 to -3.822358970913688
    Static Iteration Total: 78.9193; Orientation: 0.0759; Line Search: 55.5342
    Iteration 1 failed. Error: -3.822358970913688
    Previous Error: 0.0 -> -3.822358970913688
    Retrying iteration 1
    Reset training subject: 2892934328923
    Adding measurement e1524ad to history. Total: 0
    LBFGS Accumulation History: 1 points
    th(0)=-3.822358970913688;dx=-1.521735327736983E-8
    END: th(0.006446651157795527)=-3.822358970913688; dx=-1.3681547437363731E-8 evalInputDelta=0.0
    Fitness changed from -3.822358970913688 to -3.822358970913688
    Static Iteration Total: 31.2325; Orientation: 0.0785; Line Search: 15.6066
    Iteration 2 failed. Error: -3.822358970913688
    Previous Error: 0.0 -> -3.822358970913688
    Optimization terminated 2
    Final threshold in iteration 2: -3.822358970913688 (> -Infinity) after 110.152s (< 5400.000s)
    

Returns:

    -3.822358970913688