home *** CD-ROM | disk | FTP | other *** search
- inst4.0 !02-Jun-88 (bkpprune.ins) Backprop with pruning
- !****************************************************************
- !* *
- !* Back-Propagation with Pruning Network Builder *
- !* *
- !****************************************************************
- !
- ! Set counter "Aux 1" in the super layer to the number of
- ! interations between updating weights with the accumulated
- ! deltas.
-
- ! *** check that input / output PE count is non-zero
-
- ?&In 1
- >bge CheckOut
- @Err "Back-Propagation MUST have at least one input PE"
- :CheckOut
- ?&Out 1
- >bge OutOK
- @Err "Back-Propagation MUST have at least one output PE"
- :OutOK
- ?&Hd1 1
- >bge HidOK
- @Err "Back-Propagation MUST have at least one Hidden Layer 1 PE"
- :HidOK
-
- ! *** Load the Control Strategy and LRS if needed
-
- @LdCS "bkpprune" !control strategy
- @LdLR "bkpprunn" !L/R schedule for network
- @LdLR "bkpprunl" !L/R schedule for layers
-
- =netn "InstaNet (tm) Pruned Back-Propagation 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 "Linear" !buffer
- =Llrs "bkpprunl" !L/R Schedule
- =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 "Sigmoid" !transfer function
- =Llrn "Cum-Delta-Rule" !Generalized Delta learning rule
- =Llrs "bkpprunl" !L/R Schedule
- +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
-
- ! *** Connect the hidden layer to itself ***
-
- =SPEl LayN !point select & current to current layer
- =NPEl LayN
- =SPEn 1 !point to second PE in layer
- :HLCn
- ?SPEn &Hd1 !are we done?
- >bge DneHLCn
- @SlPE
- =NPEn 0 !start with 1st PE in layer
- :HLPC
- @NrPE
- @PCon !connect PE's together
- +NPEn 1 !next PE in row
- ?NPEn SPEn !are we done?
- >blt HLPC
- +SPEn 1 !next selected PE
- >br HLCn !go again
- :DneHLCn
- =SPEn 0
- =NPEn 0
-
- ! *** 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 "Sigmoid" !transfer function
- =Llrn "Cum-Delta-Rule" !Generalized Delta learning rule
- =Llrs "bkpprunl" !L/R Schedule
- +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
- =Ltrn "Sigmoid" !transfer function
- =Llrn "Cum-Delta-Rule" !Generalized Delta learning rule
- =Llrs "bkpprunl" !L/R Schedule
- +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 ***
-
- =DLnN 5000 !check - point re-display count
- =LnPr 1 !yes, prune
- =PrVl -5 !5% of max weight
- @LLsl !load super layer
- =Lctl "bkpprune" !backprop control strategy
- =Llrs "bkpprunn" !backprop L/R Schedule
- =Llnn "bkpprune" !name of learn input
- =Lrcn "bkpprune" !name of recall output
- #Incl "stdioset.iif" !standard I/O settings
- =Lax1 30 !nominal number of accumulations
- =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 &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
- @Nini !initialize the network
- @EOF
-
-