anchor.diff:          (funcall x trainer))))
   
   (defmethod log-training-error ((trainer mnist-rbm-trainer) (rbm mnist-rbm))
  -  (dolist (cloud (clouds rbm))
  -    (log-msg "~A: ~A~%" cloud (xxx (weights cloud))))
     (let ((counter (counter trainer))
           (n-inputs (n-inputs trainer)))
       (log-msg "TRAINING RMSE: ~,5F (~D)~%"
  
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
  
negative.code:                  (if (listp x)
                       (elt x i)
                       x)))
            (train (make-sampler *training-images*
                                 :max-n (* n-epochs (length *training-images*))
                                 :sample-visible-p (this visible-sampling))
  