;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This file is derived from SN-2.8
;;;   Copyright (C) 1987-1999 Neuristique s.a.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; $Id: tgf.sn,v 1.2 2003/03/18 21:18:30 leonb Exp $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;   Simple Linear Associator
;;;
;;;   (C) Copyright Neuristique, 1989


;;; === Loading SLA functions

(load "sla.sn")

;;; === EXAMPLE: 4x4 LETTERS RECOGNITION


;loads the examples
(load-matrix pattern-matrix "patterns.mat")
(load-matrix desired-matrix "desired.mat")
(ensemble 0 5)

;shows the examples
(de show-patterns()
    (setq patterns-window (new-window 10 10 420 100 "examples patterns"))
    (let ((window patterns-window))
      (for (i patt-min patt-max)
	   (draw-list (+ (* 60 i) 10) 30 (pattern-matrix i ()) 4 1.0 12 8) ) ) )
(show-patterns)

; builds the network
(alloc-net 20 100)
(SLA-build-net 16 1)

; sets the parameters
(epsilon 0.1)
(forget 0)

; sets the display
(set-disp-net-and-error)

; sets the classification criterion
(set-class-quadrant)

; let's go
(SLA-Delta-learn 60)
