anchor.diff:    ((counter :initform (make-instance 'rmse-counter) :reader counter)))
   
   (defmethod log-training-error ((trainer mnist-dbm-trainer) (dbm mnist-dbm))
  -  (let ((counter (counter trainer))
  -        (n-inputs (n-inputs trainer)))
  -    (log-msg "TRAINING RMSE: ~,5F (~D)~%"
  -             (or (get-error counter) #.(flt 0))
  -             n-inputs)
  +  (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)))
  -      (let ((n-inputs (n-inputs trainer)))
  -        (log-msg "TRAINING RECONSTRUCTION CLASSIFICATION ACCURACY: ~,2F (~D)~%"
  -                 (->percent (or (get-error counter) #.(flt 0)))
  -                 n-inputs)
  -        (reset-counter counter)))))
  +      (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
  
positive.code: 
  (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.
  
negative.code:                 (* (/ (n-inputs trainer)
                        (length *training-images*))
                     600)))))
  
  (defmethod momentum ((trainer mnist-dbm-segment-trainer))
    (if (< (n-inputs trainer) (* 5 (length *training-images*)))
  