anchor.diff:    learner)
   
   ;;; Averaged Perceptron
  -(defclass averaged-perceptron (perceptron)
  -  ((data-size :accessor data-size-of :initarg :data-size)
  -   (averaged-weight :accessor averaged-weight-of :initarg :averaged-weight)
  -   (averaged-bias :accessor averaged-bias-of :initarg :averaged-bias)
  -   (counter :accessor counter-of :initarg :counter)
  -   (tmp-vec :accessor tmp-vec-of :initarg :tmp-vec)))
  +(defclass$ averaged-perceptron (perceptron)
  +  data-size averaged-weight averaged-bias counter tmp-vec)
   
   (defun make-averaged-perceptron (input-dimension data-size)
     (check-type input-dimension integer)
  
positive.code:   (sign (f input (averaged-weight-of learner) (averaged-bias-of learner))))
  
  ;;; Linear SVM
  (defclass svm (learner)
    ((learning-rate :accessor learning-rate-of :initarg :learning-rate)
     (regularization-parameter :accessor regularization-parameter-of :initarg :regularization-parameter)
     (tmp-vec :accessor tmp-vec-of :initarg :tmp-vec)))
  
  (defun make-svm (input-dimension learning-rate regularization-parameter)
    (check-type input-dimension integer)
  
negative.code:   (+ (inner-product weight input) bias))
  
  ;;; Definition CLOS object
  (defclass$ learner () input-dimension weight bias)
  
  ;;; Definition generic functions
  (defgeneric predict (learner input))
  (defgeneric test (learner test-data  &key quiet-p))
  (defgeneric update (learner input training-label))
  (defgeneric train (learner training-data))
  (defgeneric train-with-interim-test (learner training-data test-data span))
  
  ;;; Prediction
  (defmethod predict ((learner learner) input)
    (sign (f input (weight-of learner) (bias-of learner))))
  
  ;;; Testing with a test data list (1-pass)
  (defmethod test ((learner learner) test-data &key (quiet-p nil))
    (let* ((len (length test-data))
  	 (n-correct (count-if (lambda (datum)
  				(= (predict learner (cdr datum)) (car datum)))
  			      test-data))
  	 (accuracy (* (/ n-correct len) 100.0)))
      (if (not quiet-p)
        (format t "Accuracy: ~f%, Correct: ~A, Total: ~A~%" accuracy n-correct len))
      (values accuracy n-correct len)))
  
  ;;; Update inner parameters destructively (1step)
  