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

  1. inst4.0    !  (Cascade.ins)  Casade Correlation w Cumulative Back-Propagation
  2. !************************************************************************
  3. !*                                            *
  4. !*    Cascade-Correlation w Cum Back-Propagation Network Builder    *
  5. !*                                            *
  6. !************************************************************************ 
  7. !
  8. !    Set counter "Aux 1" in the super layer to the number of
  9. !    iterations 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    InOK
  16. @Err    "Cascade-Correlation MUST have at least one input PE"
  17. :InOK
  18. ?&Hd1    1
  19. >bge    Hid1OK
  20. @Err    "Cascade-Correlation MUST have at least one Hidden layer"
  21. :Hid1OK
  22. ?&Out    1
  23. >bge    OutOK
  24. @Err    "Cascade-Correlation MUST have at least one output PE"
  25. :OutOK
  26.  
  27. !    *** Load the Control Strategy and LRS if needed
  28.  
  29. @LdCS    "backprop"        !control strategy
  30. @LdLR    "backprop"        !L/R schedule
  31. @LdLR    "cascade"        !Hidden layer LRS
  32.  
  33. =netn "InstaNet (tm) Cascade-Correlation w Cumulative Back-Propagation Network
  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. =x    100            !place to put layer on screen
  43. =y     80
  44. #Incl    "stdnwgtf.iif"        !standard # weight fields
  45. @LAdd                !add the input layer
  46.  
  47. !    *** Build the Hidden Layer ***
  48.  
  49. @LLdf                !start with default layer again
  50. =LDln    "Cascade"        !layer name
  51. =Llrs    "cascade"        !learning recall schedule
  52. =Lpes    &Hd1            !Proper number of PEs
  53. =Lsum    "cascade"        !cascade sum function
  54. =Ltrn    "TanH"            !transfer function
  55. =Llrn    "Norm-Cum-Delta"    !Generalized Delta learning rule
  56. =Lnse    "--None--"        !no noise function
  57. +x    150            !to right on display
  58. +y    100            !up higher on display
  59. #Incl    "stdnwgtf.iif"        !standard # weight fields
  60. @LAdd
  61.  
  62. !    *** Connect Hidden Layer to Bias 
  63.  
  64. =SPEl    LayN            !Hidden layer 1
  65. @SlPE                !select it as destination (sb already)
  66. =NPEl    -1            !near to bias term (source)
  67. @NrPE
  68. =cnwt    0.0            !connection weight = 0.0
  69. =cnty    WFix            !fixed
  70. =cnsc    WAbs            !absolute
  71. @LCFl                !fully connect to bias element
  72.  
  73. !    *** Connect to Input Layer ***
  74.  
  75. =NPEl    0            !input layer
  76. @NrPE
  77. @LCFl                !fully connect to input layer
  78.  
  79. !    *** Self Connect in Cascade fashion ***
  80.  
  81. =SPEl    LayN            !select layer is self
  82. =SPEn    1            !start with PE 1
  83. =NPEl    LayN            !near layer is self
  84. =cnty    WVar            !variable
  85. :OutLp
  86. @SlPE                !select PE
  87. =NPEn    0            !start with PE 0
  88. :InLp
  89. @NrPE                !select PE
  90. @PCon                !connect PE
  91. +NPEn    1            !advance Near PE
  92. ?NPEn    SPEn            !compare to Select PE
  93. >blt    InLp            !next near
  94. +SPEn    1            !advance Select PE
  95. ?SPEn    &Hd1            !compare to number of hidden PEs
  96. >ble    OutLp            !next select
  97.  
  98. =n1    LayN            !save Hidden layer 1 for later
  99.  
  100. !    *** Build the output layer  ***
  101.  
  102. @LLdf                !load default layer to mi_layer structure
  103. =LDln    "Output"        !layer name
  104. =Lpes    &Out            !copy # of input PEs from menu
  105. =Llrs    "backprop"        !backprop L/R Schedule
  106. =Lsum    "Cascade"        !cascade sum function
  107. =Ltrn    "TanH"            !transfer function
  108. =Llrn    "Norm-Cum-Delta"    !Generalized Delta learning rule
  109. =Lnse    "--None--"        !no noise function
  110. =x    100
  111. +y    100
  112. #Incl    "stdnwgtf.iif"        !standard # weight fields
  113. @LAdd                !add the lower output layer
  114. =n7    LayN            !save for stdprobe
  115.  
  116. !    *** Connect the output layer to input & Hidden layers  & bias term ***
  117.  
  118. =SPEl    LayN            !destination is output layer
  119. =SPEn    0
  120. @SlPE                !select destination pe
  121. =cnty    WVar            !connection type is variable
  122.  
  123. =NPEl    -1            !near to bias term (source)
  124. =NPEn    0
  125. @NrPE
  126. @LCFl                !fully connect
  127.  
  128. =NPEl    0            !near to input layer
  129. @NrPE
  130. @LCFl                !connect fully
  131.  
  132. =cnty    WFix            !connection type is fixed initially
  133. =cnwt    0.0            !connection weight 0.0 - no impact
  134. =NPEl    n1            !near to hidden layer
  135. @NrPE
  136. @LCFl
  137.  
  138. =n0    LayN            !save lower output layer for later
  139.  
  140. !    ***          Add an Output Instrument      ***
  141.  
  142. !+x    100            !to right on display
  143. !@ILdD                !load default instrument
  144. !=ITit    "Output Error"        !Instrument Title
  145. !=Ihgt    150            !Instrument Height
  146. !=Ignx    32            !Number in x direction
  147. !=Ivmx    2.            !Maximum value
  148. !=ILDv    31            !Instrument Learn
  149. !@IAdd                !Add the instrument
  150.  
  151. !    *** Select Control Strategy & L/R Schedule ***
  152.  
  153. @LLsl                !load super layer
  154. =LDnd    3            !Force network display
  155. =Lctl    "backprop"        !backprop control strategy
  156. =Llrs    "backprop"        !backprop L/R Schedule
  157. =Llnn    "4bit"            !name of learn input
  158. =Lrcn    "4bit"            !name of recall output
  159. #Incl    "stdioset.iif"        !standard I/O settings
  160. =Lax1     16            !nominal number of accumulations
  161. =Lscl     -1             !input  low-value
  162. =Loff     1            !input  high-value
  163. =Llow     -.8            !output low-value
  164. =Lhgh     .8            !output high-value
  165. @SVsl                !save the super layer back
  166. !
  167. =n5    -1.0
  168. =n6    1.0
  169. =n4    &Out
  170. #Incl    "stdprobe.iif"        !Standard probe include file
  171. !
  172. =jogl    -.1            !lower limit for jog
  173. =jogh    +.1            !upper limit for jog
  174. =seed    257            !starting seed number
  175. @seed                !set the seed
  176. @Nini                !Initialize the network
  177. @EOF
  178.