inst4.0		!10:00 03-Jun-88  (percptrn.ins)  Perceptron Network Builder
!****************************************************************
!*								*
!*	Perceptron Network Generator				*
!*								*
!****************************************************************

!	*** check that input / output PE count is non-zero

?&In	1
>bge	CheckOut
@Err	"Perceptron MUST have at least one input PE"
:CheckOut
?&Out	1
>bge	OutOK
@Err	"Perceptron MUST have at least one output PE"
:OutOK

!	*** Load the Control Strategy and LRS if needed

@LdCS	"percptrn"		!control strategy
@LdLR	"percptrn"		!L/R schedule

=netn	"InstaNet (tm) Perceptron Network version 1.00 20-Jun-88"
=DLnF	0			!learn  re-display off
=DRcF	0			!recall re-display off

!	*** Build the Input Layer ***

@LLdf				!load default layer to mi_layer structure
=LDln	"In"			!layer name
=Lpes	&In			!copy # of input PEs from menu
=Ltrn	"Perceptron"		!transfer function
=x	100			!place to put layer on screen
=y	 80
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the input layer
=n0	LayN			!track previous layer
=cnsc	WAbs			!absolute
=cnwt	1.0			!connection weight

!	*** Build the Feature Demon Layer ***

?&Hd1	0			!any hidden layer?
>ble	NoDmn			!no demons
@LLdf				!start with default layer again
=LDln	"Demon"			!layer name
=Lpes	&Hd1			!desired number of PEs
=Ltrn	"Perceptron"		!transfer function
+y	80			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

!	*** Connect Adaline Layer to Bias & Input Layers ***

=SPEl	LayN			!current layer
@SlPE				!select it as destination (sb already)
=NPEl	-1			!near to bias term (source)
@NrPE
=cnty	WVar			!variable connections
@LCFl
=cndn	0.5			!50 % connections
=NPEl	n0			!input layer
@NrPE
@LCRn
=NPEl	LayN			!randomize these weights
@NrPE
=jogl	-1.0			!randomize range
=jogh	 1.0
@Lrnd				!randomize them
=NPEl	n0			!fix the weights between these layers
@NrPE
=cnty	WFix
@LCty				!connection type
=NPEl	-1			!bias layer
@NrPE
@LCty
=n0	LayN			!track previous layer
:NoDmn

!	*** Build the output layer & connect it to prior layer ***

@LLdf				!load default layer to mi_layer structure
=LDln	"Out"			!layer name
=Lpes	&Out			!copy # of input PEs from menu
=Ltrn	"Perceptron"		!transfer function
=Llrn	"Perceptron"		!learning rule
+y	80
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the output layer
=n7	LayN			!save for stdprobe
=SPEl	LayN			!output layer
@SlPE
=NPEl	n0			!previous layer
@NrPE
=cnty	WVar
@LCFl
=NPEl	-1			!bias layer
@NrPE
@LCFl

!	*** Select Control Strategy & L/R Schedule ***

@LLsl				!load super layer
=Lctl	"percptrn"		!control strategy
=Llrs	"percptrn"		!L/R Schedule
=Llnn	"percptrn"		!name of learn input
=Lrcn	"percptrn"		!name of recall output
#Incl	"stdioset.iif"		!standard I/O settings
=Lscl	-1			!input  low-value
=Loff	 1			!input  high-value
=Llow	 0			!output low-value
=Lhgh	 1			!output high-value
@SVsl				!save it back
!
=n5	0.0
=n6	1.0
=n4	&Out
#Incl	"stdprobe.iif"		!Standard probe include file
!
=jogl	-.1			!lower limit for jog
=jogh	+.1			!upper limit for jog
=seed	257			!starting seed number
@seed				!set the seed
@Nrnd				!randomize the network

@EOF
