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

  1. inst4.0        ! 8/15/90 
  2.  
  3. !****************************************************************
  4. !*                                *
  5. !*    Self Organizing Map                              *
  6. !*                                *
  7. !****************************************************************
  8. !
  9. !    Set counter "Aux 1" in the super layer to the number of
  10. !    interations between updating weights with the accumulated
  11. !    deltas.
  12.  
  13. !    *** check that input / hidden PE count is non-zero
  14.  
  15. ?&In    2
  16. >bge    InOK
  17. @Err    "Network MUST have at least two input PE's"
  18. :InOK
  19.  
  20. ?&Hd1    1
  21. >bge    Hid1OK
  22. @Err    "Kohonen Layer MUST have at least row column of PE's"
  23. :Hid1OK
  24.  
  25. ?&Hd2    1
  26. >bge    Hid2OK
  27. @Err    "Kohonen Layer MUST have at least 1 column of PE's"
  28. :Hid2OK
  29.  
  30. !    *** Load the Control Strategy and LRS if needed
  31.  
  32. @LdCS    "som"            !som control strategy
  33. @LdLR    "som"            !som L/R schedule
  34. =netn "Self Organizing Map version 1.00 15-Aug-90"
  35. =DLnF    0            !learn  re-display off
  36. =DRcF    0            !recall re-display off
  37.  
  38. !    *** Build the Input Layer ***
  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. =x    100            !place to put layer on screen
  44. =y     80
  45. #Incl    "stdnwgtf.iif"        !standard # weight fields
  46. @LAdd                !add the input layer
  47.  
  48. !    *** Build the Kohonen Layer ***
  49.  
  50. @LLdf                !start with default layer again
  51. =LDln    "2-D Kohonen"        !layer name
  52. =Lpes    &Hd1            !number of rows of PEs
  53. *Lpes    &Hd2            !times number of cols
  54. =n4    Lpes            !save for standard instruments
  55. =LDnr   &Hd1            !number of rows
  56. =LInL     -0.10            !Init low value
  57. =LInH    0.10            !Init high value
  58. =Lsum    "SOM"            !SOM summation function
  59. =Llrn    "SOM"            !SOM learning rule
  60. =Lcmp    "SOM"            !no output function required
  61. =Llrs    "som"            !som L/R schedule
  62. +y    60            !up higher on display
  63. ?&Hd2    15            !if 15 or more cols, shrink display
  64. >blt    small
  65. ?&Hd2   21        
  66. >blt    medium            
  67. =LDsp    2            !21 or more cols
  68. >br    small
  69. :medium
  70. =LDsp    4            !between 15 and 20 cols
  71. :small
  72. #Incl    "stdnwgtf.iif"        !standard # weight fields
  73. @LAdd                !less than 15 cols
  74. =n7    LayN            !save for stdprobe
  75.  
  76. !    *** Connect Kohonen to Input Layer ***
  77.  
  78. =SPEl    LayN            !2-D Kohonen layer
  79. @SlPE                !select it as destination 
  80. =NPEl    0            !previous layer
  81. @NrPE
  82. =cnwt    0.0            !connection weight
  83. =cnty    WVar            !variable
  84. =cnsc    WAbs            !absolute
  85. @LCFl                !fully connect to input layer
  86. =n0    LayN            !save 2-D Kohonen layer for later
  87.  
  88.  
  89. !    *** Select Control Strategy & L/R Schedule ***
  90.  
  91. @LLsl                !load super layer
  92. =Lctl    "som"            !self organ. map control strategy
  93. =Llrs    "som"            !self organ. map L/R Schedule
  94. =Llnn    "train"          !name of learn input
  95. =Lrcn    "test"          !name of recall output
  96. #Incl    "stdioset.iif"        !standard I/O settings
  97. =Lax1    1            !epoch size
  98. =Lscl     -1.0            !input  low-value
  99. =Loff     1.0            !input  high-value
  100. =Llow     0.0            !output low-value
  101. =Lhgh     1.0            !output high-value
  102. =Lepc    0            !learn count=0
  103. @SVsl                !save it back
  104. !
  105. @Nini                !initialize the network
  106. !
  107. =n5    0.0
  108. =n6    1.0
  109. #Incl    "stdprobe.iif"        !Standard probe include file
  110. !
  111. @EOF
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.