anchor.diff:                            :if-exists :append
                             :if-does-not-exist :create)
       (write-log-entry stream
  -                     (format nil "~a ~a ~a ~a ~a"
  +                     (format nil "~a ~a ~5$ ~4$ ~4$"
                                elapsed iteration
                                mse (min-mse net) (max-mse net)))))
   
  
positive.code:                          :transfer-tag (transfer-tag layer))
            (neuron-array layer)))))
  
  (defun bound-sigmoid (neuron)
    (declare (t-neuron neuron))
    (let* ((limit 80)
           (input (max (min (input neuron) limit) (- limit))))
      (/ 1.0 (1+ (exp (- input))))))
  
  (defun bound-sigmoid-derivative (neuron)
    (declare (t-neuron neuron))
    (let ((output (output neuron)))
      (* output (- 1 output))))
  
  (defun sigmoid (neuron)
    (declare (t-neuron neuron))
    (/ 1.0 (1+ (exp (- (input neuron))))))
  
  (defun sigmoid-derivative (neuron)
    (declare (t-neuron neuron))
    (let ((output (output neuron)))
      (* output (- 1 output))))
  
  (defun rectified-linear (neuron)
    (declare (t-neuron neuron))
    (max 0 (input neuron)))
  
  (defun rectified-linear-derivative (neuron)
    (declare (t-neuron neuron))
    (let ((output (output neuron)))
      (if (< output 0) 0 output)))
  
  (defun transfer-functions (name function-or-derivative)
    (ds-get (ds `(:map :bound-sigmoid
                       (:map :function ,#'bound-sigmoid
                             :derivative ,#'bound-sigmoid-derivative)
  
                       :sigmoid
                       (:map :function ,#'sigmoid
                             :derivative ,#'sigmoid-derivative)
  
                       :rectified-linear
                       (:map :function ,#'rectified-linear
                             :derivative ,#'rectified-linear-derivative)))
            name function-or-derivative))
  
  (defclass t-net ()
    ((topology :reader topology :initarg :topology
               :initform (error ":topology required"))
     (learning-rate :reader learning-rate :initarg :learning-rate :initform 0.1)
     (momentum :reader momentum :initarg :momentum :initform 0.3)
     (wi :accessor wi :initform 0)
     (transfer-tag :accessor transfer-tag :initarg :transfer-tag :initform :sigmoid)
     (layers :accessor layers)
     (next-id :accessor next-id :initform 0)
     (min-mse :accessor min-mse :type real :initform 1000000.0)
  
negative.code:        do (backprop layer))
      net))
  
  (defgeneric update-weights (component)
    (:method ((neuron t-neuron))
      (loop
         with learning-rate = (learning-rate (net neuron))
         with momentum = (momentum (net neuron))
         with output = (output neuron)
         for cx in (cxs neuron)
         for delta = (* learning-rate (err (target cx)) output)
         do (incf (weight cx) (+ delta (* momentum (delta cx))))))
    (:method ((layer t-layer))
      (loop for neuron across (neuron-array layer)
         do (update-weights neuron)))
    (:method ((net t-net))
      (loop for layer in (layers net) 
         do (update-weights layer))))
  
  (defmethod output-layer-error ((net t-net) (outputs vector))
    (loop for neuron across (neuron-array (output-layer net))
       for expected-output across outputs
       for actual-output = (output neuron)
       do (setf (expected-output neuron) expected-output)
       summing
         (* 0.5 (expt (- expected-output actual-output) 2))
       into error
       finally (return (sqrt error))))
  
  (defmethod learn-vector ((inputs vector) (outputs vector) (net t-net))
    (feed net inputs)
    (let ((err (output-layer-error net outputs)))
      (backprop net)
      (update-weights net)
      err))
  
  (defun tset-list-to-tset-vectors (tset)
  