anchor.diff:    (/ (slot-value trainer 'learning-rate)
        (min (flt 10)
             (expt 1.000015
  -                (* (/ (n-inputs trainer)
  -                      (length *training-images*))
  +                (* (/ (n-inputs trainer) (n-inputs-in-epoch trainer))
                      600)))))
   
   (defmethod momentum ((trainer mnist-dbm-segment-trainer))
  -  (if (< (n-inputs trainer) (* 5 (length *training-images*)))
  +  (if (< (n-inputs trainer) (* 5 (n-inputs-in-epoch trainer)))
         #.(flt 0.5)
         #.(flt 0.9)))
   
  
positive.code:                (if (and x (listp x))
                     (elt x i)
                     x)))
          (let* ((n (length *training-images*))
                 (trainer
                   (make-instance 'mnist-rbm-trainer
                                  :segmenter
                                  (lambda (cloud)
                                    (make-instance 'mnist-rbm-segment-trainer
                                                   :learning-rate
                                                   (this learning-rate)
                                                   :weight-decay
  
negative.code: 
  (defvar *training-images*)
  (defvar *test-images*)
  
  (defun training-images ()
    (unless (boundp '*training-images*)
      (setq *training-images* (load-training)))
    *training-images*)
  
  (defun test-images ()
    (unless (boundp '*test-images*)
      (setq *test-images* (load-test)))
    *test-images*)
  
  
  ;;;; Sampling, clamping, utilities
  
  (defun make-sampler (images &key (max-n (length images)) omit-label-p
                       sample-visible-p)
    (make-instance 'counting-function-sampler
                   :max-n-samples max-n
                   :sampler (let ((g (make-random-generator images)))
                              (lambda ()
                                (list (funcall g)
                                      :omit-label-p omit-label-p
                                      :sample-visible-p sample-visible-p)))))
  
  (defun make-tiny-sampler (images &key omit-label-p)
    (make-sampler (subseq images 0 1000) :omit-label-p omit-label-p))
  
  (defun sample-image-array (sample)
    (image-array (first sample)))
  