anchor.diff:  
   (defclass mnist-dbm-segment-trainer (batch-gd-trainer) ())
   
  -;; (defun linear (a b x)
  -;;   (+ a (* b x)))
  -
  -;; (defun linear-at-points (x1 y1 x2 y2 x)
  -;;   (let ((b (/ (- y2 y1) (- x2 x1))))
  -;;     (linear (- (* b (- x1 (/ y1 b)))) b x)))
  -
  -;; (assert (= 0 (linear-at-points 3 1 5 2 1)))
  -;; (assert (= 1 (linear-at-points 3 1 5 2 3)))
  -;; (assert (= 2 (linear-at-points 3 1 5 2 5)))
  -;; (assert (= 3 (linear-at-points 3 1 5 2 7)))
  -
   (defmethod learning-rate ((trainer mnist-dbm-segment-trainer))
     ;; This is adjusted for each batch. Ruslan's code adjusts it per
     ;; epoch.
  
positive.code:   (call-next-method)
    (multiple-value-bind (e ce)
        (bpn-error (make-test-sampler :omit-label-p t) bpn)
      (log-msg "TEST CROSS ENTROPY ERROR: ~,5F (~D)~%"
               ce (n-inputs trainer))
      (log-msg "TEST CLASSIFICATION ACCURACY: ~? (~D)~%"
               *percent-format* (->percent e) (n-inputs trainer))))
  
  (defmethod compute-derivatives :around (samples (trainer mnist-cg-bp-trainer)
                                                  bpn)
  
negative.code:   ((counter :initform (make-instance 'rmse-counter) :reader counter)))
  
  (defmethod log-training-error ((trainer mnist-dbm-trainer) (dbm mnist-dbm))
    (let ((counter (counter trainer)))
      (log-msg "TRAINING RMSE: ~,5G~%" (or (get-error counter) #.(flt 0)))
      (reset-counter counter))
    (dolist (counter-and-measurer
              (training-classification-counters-and-measurers dbm))
      (let ((counter (car counter-and-measurer)))
        (log-msg "TRAINING RECONSTRUCTION CLASSIFICATION ACCURACY: ~,2G~%"
                 (->percent (or (get-error counter) #.(flt 0))))
        (reset-counter counter))))
  
  (defun mnist-dbm-mean-field-errors
      (sampler bm &key
  