;;;; -*- mode:Lisp; syntax:Common-Lisp; package:user -*- ;;;;
;;;; Copyright 1992 Patrick H. Winston.  All rights reserved.
;;;; Version 1.1.1, transferred from master disk on 23 Apr 93
;;;;
;;;; This file may reference other files containing copyrighted software.
;;;; Any restrictions on the use of such software are described in the
;;;; files containing that software.  This file may be freely copied as
;;;; long as this notice is kept intact.

;;;; Purpose: program support for Chapter 24, Learning by Training
;;;;	      Approximation Nets

;;;; LOAD INTERPOLATION/APPROXIMATION SYSTEM
(load "solve.lsp")	;For solving linear equations
(load "cast.lsp")	;For interpolation/approximation

;;;; RUN INTERPOLATION/APPROXIMATION SYSTEM

(format t "~%Four weights trained with four samples; sigma = 1, 4, and 16:")
(print-weights (make-interpolation-net 1.0 (5 4) (9 7) (2 9) (6 12)))
(print-weights (make-interpolation-net 4.0 (5 4) (9 7) (2 9) (6 12)))
(print-weights (make-interpolation-net 16.0 (5 4) (9 7) (2 9) (6 12)))

(format t "~%Two weights, trained with two samples, sigma = 4:")
(setf net (make-interpolation-net 4.0 (9 7) (6 12)))
(print-weights-and-centers net)

(format t "~%Next, net weights are trained using original ~
	     samples plus two more:")
(print-weights-and-centers
  (train-weights net .1 101 (5 4) (9 7) (2 9) (6 12)))

(format t "~%Next, net weights and centers are trained using original ~
	     samples plus two more:")
(setf net (make-interpolation-net 4.0 (9 7) (6 12)))
(print-weights-and-centers
  (train-weights-and-centers net .1 101 (5 4) (9 7) (2 9) (6 12)))



