inst4.0		!01-Jun-89  (bsbhebb.ins)  BSB Hebbian Network Builder
!****************************************************************
!*								*
!*	Brain-State-in-a-Box (Hebbian) Network Generator	*
!*								*
!****************************************************************

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

?&In	1
>bge	CheckOut
@Err	"Brain-State-in-a-Box MUST have at least one input PE"
:CheckOut

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

@LdCS	"hopfield"		!control strategy
@LdLR	"bsbhebb"		!L/R schedule

=netn	"InstaNet (tm) BSB Hebbian Network version 2.00 01-Jun-89"
=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	"Signum0"		!transform inputs to -1,0,+1
=x	100			!place to put layer on screen
=y	 60
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd				!add the input layer
=n0	LayN			!track previous layer

!	*** Build the Hopfield Layer ***

@LLdf				!start with default layer again
=LDln	"The Brain"		!layer name
=Lpes	&In			!desired number of PEs
=Llrn	"BSB:Hebb"		!learning rule
=Ltrn	"BSB"			!transfer function
=Llow	-1.3			!low limit for outputs
=Lhgh	 1.3			!high limit for outputs
=LInL	0.0			!low initialization limit
=LInH	0.0			!high initialization limit
+y	170			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd

!	*** Connect it to the input layer ***

=SPEl	LayN			!current layer
@SlPE
=NPEl	n0			!input layer
@NrPE
=cnwt	1.0			!unit weight
=cnsc	WRel
=cnty	WSet
@LCCr				!connect corresponding items

!	*** Connect it to itself ***

=NPEl	LayN
@NrPE
=cnwt	0.0			!zero weights
=cnty	WVar			!trainable
=cnsc	WAbs
=cndn	50.0			!50 % interconnection
@LCRn				!Randomly connect (except diagonal)
=n0	LayN			!track previous layer

!	*** Feed PEs back to themselves in this layer ***

=cnwt	1.0			!unit weight modulated by mod factor
=cnty	WMod
@LCCr

!	*** Build the Output Layer ***

@LLdf				!start with default layer again
=LDln	"Output"		!layer name
=Lpes	&In			!desired number of PEs
+y	60			!up higher on display
#Incl	"stdnwgtf.iif"		!standard # weight fields
@LAdd
=n7	LayN			!save for stdprobe

!	*** Connect the output layer back to the hopfield layer ***

=SPEl	LayN			!select output layer
@SlPE
=cnwt	1.0			!unit weight
=cnty	WFix			!fixed
=cnsc	WRel
@LCCr

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

@LLsl				!load super layer
=Lctl	"hopfield"		!control strategy
=Llrs	"bsbhebb"		!L/R Schedule
=Llnn	"bsbhebb"		!name of learn input
=Lrcn	"bsbhebb"		!name of recall output
+Lflg	LAAs			!auto-associative
=Lscl	-1			!input  low-value
=Loff	 1			!input  high-value
=Llow	-1			!output low-value
=Lhgh	 1			!output high-value
@SVsl				!save it back
!
=n5	-1.0
=n6	1.0
=n4	&In
#Incl	"stdprobe.iif"		!Standard probe include file
!
@EOF
