home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e065 / 1.ddi / BKPPRUNE.INS < prev    next >
Encoding:
Text File  |  1991-08-28  |  4.8 KB  |  177 lines

  1. inst4.0        !02-Jun-88  (bkpprune.ins) Backprop with pruning
  2. !****************************************************************
  3. !*                                *
  4. !*    Back-Propagation with Pruning Network Builder        *
  5. !*                                *
  6. !****************************************************************
  7. !
  8. !    Set counter "Aux 1" in the super layer to the number of
  9. !    interations between updating weights with the accumulated
  10. !    deltas.
  11.  
  12. !    *** check that input / output PE count is non-zero
  13.  
  14. ?&In    1
  15. >bge    CheckOut
  16. @Err    "Back-Propagation MUST have at least one input PE"
  17. :CheckOut
  18. ?&Out    1
  19. >bge    OutOK
  20. @Err    "Back-Propagation MUST have at least one output PE"
  21. :OutOK
  22. ?&Hd1    1
  23. >bge    HidOK
  24. @Err    "Back-Propagation MUST have at least one Hidden Layer 1 PE"
  25. :HidOK
  26.  
  27. !    *** Load the Control Strategy and LRS if needed
  28.  
  29. @LdCS    "bkpprune"        !control strategy
  30. @LdLR    "bkpprunn"        !L/R schedule for network
  31. @LdLR    "bkpprunl"        !L/R schedule for layers
  32.  
  33. =netn "InstaNet (tm) Pruned Back-Propagation Network version 1.00 20-Jun-88"
  34. =DLnF    0            !learn  re-display off
  35. =DRcF    0            !recall re-display off
  36.  
  37. !    *** Build the Input Layer ***
  38.  
  39. @LLdf                !load default layer to mi_layer structure
  40. =LDln    "In"            !layer name
  41. =Lpes    &In            !copy # of input PEs from menu
  42. =Ltrn    "Linear"        !buffer
  43. =Llrs    "bkpprunl"        !L/R Schedule
  44. =x    100            !place to put layer on screen
  45. =y     80
  46. #Incl    "stdnwgtf.iif"        !standard # weight fields
  47. @LAdd                !add the input layer
  48.  
  49. !    *** Build the first hidden Layer ***
  50.  
  51. @LLdf                !start with default layer again
  52. =LDln    "Hidden 1"        !layer name
  53. =Lpes    &Hd1            !Proper number of PEs
  54. =Ltrn    "Sigmoid"        !transfer function
  55. =Llrn    "Cum-Delta-Rule"    !Generalized Delta learning rule
  56. =Llrs    "bkpprunl"        !L/R Schedule
  57. +y    60            !up higher on display
  58. #Incl    "stdnwgtf.iif"        !standard # weight fields
  59. @LAdd
  60.  
  61. !    *** Connect Hidden Layer to Bias & Input Layers ***
  62.  
  63. =SPEl    LayN            !current layer
  64. @SlPE                !select it as destination (sb already)
  65. =NPEl    -1            !near to bias term (source)
  66. @NrPE
  67. =cnwt    1.0            !connection weight
  68. =cnty    WVar            !variable
  69. =cnsc    WAbs            !absolute
  70. @LCFl                !fully connect to bias element
  71. =NPEl    0            !input layer
  72. @NrPE
  73. @LCFl                !fully connect to input layer
  74. =n0    LayN            !save current layer for later
  75.  
  76. !    *** Connect the hidden layer to itself ***
  77.  
  78. =SPEl    LayN            !point select & current to current layer
  79. =NPEl    LayN
  80. =SPEn    1            !point to second PE in layer
  81. :HLCn
  82. ?SPEn    &Hd1            !are we done?
  83. >bge    DneHLCn
  84. @SlPE
  85. =NPEn    0            !start with 1st PE in layer
  86. :HLPC
  87. @NrPE
  88. @PCon                !connect PE's together
  89. +NPEn    1            !next PE in row
  90. ?NPEn    SPEn            !are we done?
  91. >blt    HLPC
  92. +SPEn    1            !next selected PE
  93. >br    HLCn            !go again
  94. :DneHLCn
  95. =SPEn    0
  96. =NPEn    0
  97.  
  98. !    *** Build the Second hidden Layer ***
  99.  
  100. ?&Hd2    0
  101. >ble    NoHid2            !skip adding second hidden layer
  102.  
  103. @LLdf                !start with default layer again
  104. =LDln    "Hidden 2"        !layer name
  105. =Lpes    &Hd2            !Proper number of PEs
  106. =Ltrn    "Sigmoid"        !transfer function
  107. =Llrn    "Cum-Delta-Rule"    !Generalized Delta learning rule
  108. =Llrs    "bkpprunl"        !L/R Schedule
  109. +y    60            !up higher on display
  110. #Incl    "stdnwgtf.iif"        !standard # weight fields
  111. @LAdd
  112.  
  113. !    *** Connect Hidden Layer 2 to Bias & Input Layers ***
  114.  
  115. =SPEl    LayN            !current layer
  116. @SlPE                !select it as destination (sb already)
  117. =NPEl    -1            !near to bias term (source)
  118. @NrPE
  119. @LCFl                !fully connect to bias element
  120. =NPEl    n0            !previous layer
  121. @NrPE
  122. @LCFl                !fully connect to input layer
  123. =n0    LayN            !save current layer for later
  124. :NoHid2
  125.  
  126. !    *** Build the output layer & connect it to prior layer & bias term ***
  127.  
  128. @LLdf                !load default layer to mi_layer structure
  129. =LDln    "Out"            !layer name
  130. =Lpes    &Out            !copy # of input PEs from menu
  131. =Ltrn    "Sigmoid"        !transfer function
  132. =Llrn    "Cum-Delta-Rule"    !Generalized Delta learning rule
  133. =Llrs    "bkpprunl"        !L/R Schedule
  134. +y    60
  135. #Incl    "stdnwgtf.iif"        !standard # weight fields
  136. @LAdd                !add the output layer
  137. =n7    LayN            !save for stdprobe
  138. =SPEl    LayN            !current layer
  139. @SlPE                !select it as destination (sb already)
  140. =NPEl    -1            !near to bias term (source)
  141. @NrPE
  142. @LCFl                !fully connect to bias element
  143. =NPEl    n0            !previous layer
  144. @NrPE
  145. @LCFl                !fully connect to input layer
  146.  
  147. !    *** Select Control Strategy & L/R Schedule ***
  148.  
  149. =DLnN    5000            !check - point re-display count
  150. =LnPr    1            !yes, prune
  151. =PrVl    -5            !5% of max weight
  152. @LLsl                !load super layer
  153. =Lctl    "bkpprune"        !backprop control strategy
  154. =Llrs    "bkpprunn"        !backprop L/R Schedule
  155. =Llnn    "bkpprune"        !name of learn input
  156. =Lrcn    "bkpprune"        !name of recall output
  157. #Incl    "stdioset.iif"        !standard I/O settings
  158. =Lax1    30            !nominal number of accumulations
  159. =Lscl     0            !input  low-value
  160. =Loff     1            !input  high-value
  161. =Llow     0            !output low-value
  162. =Lhgh     1            !output high-value
  163. @SVsl                !save it back
  164. !
  165. =n5    0.0
  166. =n6    1.0
  167. =n4    &Out
  168. #Incl    "stdprobe.iif"        !Standard probe include file
  169. !
  170. =jogl    -.1            !lower limit for jog
  171. =jogh    +.1            !upper limit for jog
  172. =seed    257            !starting seed number
  173. @seed                !set the seed
  174. @Nini                !initialize the network
  175. @EOF
  176.  
  177.