inst4.0		! 14-Sept-88  (recirc.ins) Recirculation Network Builder
!****************************************************************
!*								*
!*	Recirculation Network Generator				*
!*								*
!****************************************************************

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

?&In	1
>bge	CheckHid
@Err	"Recirculation Network MUST have at least one input PE"
:CheckHid
?&Hd1	1
>bge	HidOK
@Err	"Recirculation Network MUST have at least one hidden PE"
:HidOK

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

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

=netn	"InstaNet (tm) Recirculation Network version 1.00 26-08-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
=x	100			!place to put layer on screen
=y	 60
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the input layer

!	*** Build the Visible layer ***

@LLdf				!start with default layer again
=LDln	"Visible"		!layer name
=Lpes	&In			!copy # of input PEs from menu
=Ltrn	"Sigmoid"		!transfer function - could also be linear
=Llrn	"Cum-Delta-Rule"	!Cumulative delta
+y	60			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

!	*** Connect Visible Layer to Input Layer ***

=SPEl	LayN			!current layer
@SlPE				!select it as destination (sb already)
=NPEl	0			!input layer
@NrPE
=cnwt	1.0			!connection weight
=cnty	WSet			!set weights
=cnsc	WAbs			!absolute
@LCCr				!correspondingly connect to input layer
=n0	LayN			!save current layer for later

!	*** Build the Hidden layer ***

@LLdf				!start with default layer again
=LDln	"Hidden"		!layer name
=Lpes	&Hd1			!Proper number of PEs
=Ltrn	"Sigmoid"		!transfer function
=Llrn	"Cum-Delta-Rule"	!Cumulative delta
+y	60			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

!	*** Connect hidden layer to visible layer and bias

=cnwt	0.0			!zero weights to start
=cnty	WVar			!variable
=SPEl	LayN			!hidden destination
@SlPE
=NPEl	n0			!visible source
@NrPE
@LCFl				!visible layer to hidden layer
=NPEl	-1			!Bias Source
@NrPE
@LCFl				!Bias to hidden
=n1	LayN			!track hidden layer

!	*** Connect visible layer to hidden layer and bias

=cnwt	0.0			!zero weights to start
=cnty	WVar			!variable
=SPEl	n0			!visible destination
@SlPE
=NPEl	n1			!hidden source
@NrPE
@LCFl				!hidden layer to visible layer
=NPEl	-1			!Bias Source
@NrPE
@LCFl				!Bias to visible

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

@LLdf				!load default layer to mi_layer structure
=LDln	"Out"			!layer name
=Lpes	&In			!copy # of input PEs from menu
+y	70
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the output layer
=n7	LayN			!save for stdprobe
=SPEl	LayN			!output layer
@SlPE
=NPEl	n0			!Visible layer
@NrPE
=cnty	WFix
=cnwt	1.0
@LCCr

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

@LLsl				!load super layer
=Lctl	"recirc"		!control strategy
=Llrs	"recirc"		!L/R Schedule
=Llnn	"recirc"		!name of learn input
=Lrcn	"recirc"		!name of recall output
#Incl	"stdioset.iif"		!standard I/O settings
=Lax1	&In			!nominal number of accumulations
+Lflg	LAAs			!auto-associative network
=Lscl	 0			!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	&In
#Incl	"stdprobe.iif"		!Standard probe include file
!
=jogl	-.5			!lower limit for jog
=jogh	+.5			!upper limit for jog
=seed	257			!starting seed number
@seed				!set the seed
@Nrnd				!randomize the network
@EOF
