inst3.0		!14:00 03-Jun-90  (edbd.ins) Ex-Delta-Bar-Delta InstaNet
!****************************************************************
!*								*
!*	Extended-Delta-Bar-Delta Network Builder		*
!*								*
!****************************************************************

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

?&In	1
>bge	CheckOut
@Err	"Ex-Delta-Bar-Delta MUST have at least one input PE"
:CheckOut
?&Out	1
>bge	OutOK
@Err	"Ex-Delta-Bar-Delta MUST have at least one output PE"
:OutOK
?&Hd1	1
>bge	HidOK
@Err	"Ex-Delta-Bar-Delta MUST have at least one Hidden Layer 1 PE"
:HidOK

!	*** Load the Control Strategy and LRS

@LdCS	"dbd"			!control strategy
@LdLR	"edbd"			!L/R schedule

=netn	"InstaNet (tm) Extended Delta-Bar-Delta Network version 1.00 30-May-90"
=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	"Linear"		!buffer
=x	100			!place to put layer on screen
=y	 80
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the input layer

!	*** Build the first hidden Layer ***

@LLdf				!start with default layer again
=LDln	"Hidden 1"		!layer name
=Lpes	&Hd1			!Proper number of PEs
=Ltrn	"TanH"   		!transfer function
=Llrn	"Ext DBD"		!EDBD learning rule
+y	60			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

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

=SPEl	LayN			!current layer
@SlPE				!select it as destination (sb already)
=NPEl	-1			!near to bias term (source)
@NrPE
=cnwt	1.0			!connection weight
=cnty	WVar			!variable
=cnsc	WAbs			!absolute
@LCFl				!fully connect to bias element
=NPEl	0			!input layer
@NrPE
@LCFl				!fully connect to input layer
=n0	LayN			!save current layer for later

!	*** Build the Second hidden Layer ***

?&Hd2	0
>ble	NoHid2			!skip adding second hidden layer

@LLdf				!start with default layer again
=LDln	"Hidden 2"		!layer name
=Lpes	&Hd2			!Proper number of PEs
=Ltrn	"TanH"   		!transfer function
=Llrn	"Ext DBD"		!EDBD learning rule
+y	60			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

!	*** Connect Hidden Layer 2 to Bias & Input Layers ***

=SPEl	LayN			!current layer
@SlPE				!select it as destination (sb already)
=NPEl	-1			!near to bias term (source)
@NrPE
@LCFl				!fully connect to bias element
=NPEl	n0			!previous layer
@NrPE
@LCFl				!fully connect to input layer
=n0	LayN			!save current layer for later
:NoHid2

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

@LLdf				!load default layer to mi_layer structure
=LDln	"Out"			!layer name
=Lpes	&Out			!copy # of input PEs from menu
=n4	Lpes			!save for standard instruments
=Ltrn	"TanH"   		!transfer function
=Llrn	"Ext DBD"		!EDBD learning rule
+y	60
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the output layer
=n7	LayN			!save for stdprobe

=SPEl	LayN			!current layer
@SlPE				!select it as destination (sb already)
=NPEl	-1			!near to bias term (source)
@NrPE
@LCFl				!fully connect to bias element
=NPEl	n0			!previous layer
@NrPE
@LCFl				!fully connect to input layer

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

@LLsl				!load super layer
=Lctl	"dbd"			!delta-bar-delta control strategy
=Llrs	"edbd"			!ex-delta-bar-delta L/R Schedule
=Llnn	"train"			!name of learn input
=Lrcn	"test"			!name of recall output
=Lrio	33			!Sequential, show des. O/P (0x21)
=Llio	65			!Sequential, Binary (0x41)
?OSDs	0			!Dos version?
>bne	IsDos			!Yes
+Llio	256			!Load learn file into RAM
:IsDos
=Lscl	 -1.0			!input  low-value
=Loff	 1.0			!input  high-value
=Llow	 -0.8			!output low-value
=Lhgh	 0.8			!output high-value
@SVsl				!save it back
=jogl	-.1			!lower limit for jog
=jogh	+.1			!upper limit for jog
=seed	257			!starting seed number
@seed				!set the seed
@Nini				!initialize the network
!
=n5	-1.0
=n6	1.0
#Incl	"stdprobe.iif"		!Standard probe include file
@EOF

