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

  1. inst4.0        ! Oct 29 1990
  2. !****************************************************************
  3. !*                                *
  4. !*    Easy Probe Script                    *
  5. !*                                *
  6. !****************************************************************
  7. !
  8. !Preliminaries
  9. !
  10. =PNam    "Output"        !Start off with default probe
  11. !
  12. @LLsl                !Load super layer
  13. ?EPEp    0            !Epoch requested
  14. >beq    Aux1Set            !No
  15. ?Lax1    0            !Has Aux 1 (Epoch) been set up?
  16. >bgt    Aux1Set            !Yes
  17. =Lax1    16            !Set a default value
  18. @SVsl
  19. :Aux1Set
  20. !Calculate output layer number (n5) and #PEs in output (n4)
  21. @LLsl                !Load super layer
  22. =n5    Lpes            !number of layers
  23. -n5    1            !output layer number
  24. =LayN    n5            !Look at output layer
  25. @LLly                !Load it
  26. =n4    Lpes            !# PEs in output layer
  27. !Use n7 to flag a potentially bipolar output
  28. =n7    0            !Unipolar by default
  29. ?Ltrn    "Sigmoid"        !Sigmoid?
  30. >beq    UniPolar        !Yes
  31. ?Lcmp    "Direct"        !Direct
  32. >bne    UniPolar        !No
  33. ! Direct, non-sigmoid are potentially BiPolar
  34. =n7    1            !Bipolar
  35. :UniPolar
  36. !Calculate #PEs in network (n6)
  37. =n6    n4            !# PEs in network (Except input and bias)
  38. =LayN    n5            !Output layer
  39. :CountPEs
  40. -LayN    1            !Next layer Down
  41. ?LayN    0            !At Input layer?
  42. >ble    PEsCnted        !Yes
  43. @LLly                !Load next layer
  44. +n6    Lpes            !increment number of PEs
  45. >br    CountPEs
  46. :PEsCnted
  47. !
  48. ! Now check if we need to prompt for probes
  49. ?EPPb    2            !Layer Probe?
  50. >beq    PromptPb        !Yes
  51. ?EPPb    4            !PE Probe?
  52. >beq    PromptPb        !Yes
  53. >br    NoPrompt        !Don't Prompt
  54. :PromptPb
  55. @Vars    NP            !Prompt for near layer and position
  56. @NrLX                !Get layer index of PE
  57. ?NPEl    0
  58. >bge BldProbe
  59. @Err    "Invalid PE (Bias) selected for instrument"
  60. !
  61. :BldProbe            ! Need to construct a probe
  62. ?EPPb    4            ! PE Probe?
  63. >beq    PEProbe
  64. =PNam    "_lay_"
  65. +PNam    NPEl            !Append layer number to name
  66. @PbAS                !Add Probe
  67. @PbDC                !Delete all components
  68. @PALy                !Add Near Layer to Probe
  69. ! Now save #PEs in layer for future reference
  70. =LayN    NPEl            !Pointed to layer
  71. @LLly                !Load it
  72. =n4    Lpes            !# PEs in Probe
  73. =n3    n4
  74. /n3    LDnr            !Divide by #rows in display
  75. >br    BldInstr
  76. !
  77. :PEProbe
  78. =PNam    "_pe_"            !prefix
  79. +PNam    NPEn            !Index in layer
  80. @PbAS                !Add Probe
  81. ?PbSt    0            !Check status of probe
  82. >bne    PEPbOK            !OK, not there yet
  83. =n0    n6            !Look for Unique probe
  84. =n1    n0
  85. +n1    100            !Give up after 100
  86. :PEPb1
  87. +n0    1
  88. ?n0    n1
  89. >beq    PEPb2
  90. =PNam    "_pe_"            !prefix
  91. +PNam    n0            !Arbitrary suffix
  92. @PbAS                !Add Probe
  93. ?PbSt    0            !Check status of probe
  94. >beq    PEPb1            !Already there, try again
  95. :PEPbOK
  96. @PAPE                !Add Near PE to probe
  97. =n4    1            !# PEs in Probe
  98. =n3    1            !#x
  99. >br    BldInstr
  100. :PEPb2
  101. @Err    "Probe table full; cannot create confusion matrix"
  102.  
  103. :NoPrompt
  104. @Vars    P            !Prompt position only
  105. ?EPPb    0            !Network Probe?
  106. >bne    NotNetWk
  107. =n4    n6            !# PEs in Probe
  108. =n3    n6            !#x
  109. >br    BldInstr
  110. :NotNetWk
  111. ?EPPb    1            !Output Probe?
  112. >bne    NotOutLy
  113. =LayN    n5            !Output layer
  114. @LLly                !Load it
  115. =n4    Lpes            !# PEs in Probe
  116. =n3    n4
  117. /n3    LDnr            !Divide by #rows in display
  118. ! If it is the output layer and the graph is a histogram,
  119. ! we must build a probe consisting of just the output
  120. ! layer. The default probe which consists of all layers
  121. ! except the input layer will not do because a histogram
  122. ! instrument will read all the values off the probe. Note:
  123. ! Only do this for Histograms, otherwise NeuralWorks
  124. ! Explorer will not be able to do other output instruments
  125. ?EPGr    3            !Histogram?
  126. >bne    BldInstr        !No
  127. =PNam    "_out_lay"        !Probe name
  128. =NPEl    n5            !Output Layer
  129. @NrPE                !Point to it
  130. @PbAS                !Add Probe
  131. @PbDC                !Delete all components
  132. @PALy                !Add Near Layer to Probe
  133. >br    BldInstr
  134. :NotOutLy
  135. ! Must be input layer
  136. =LayN    0
  137. @LLly                !Load it
  138. =n4    Lpes            !# PEs in Probe
  139. =n3    n4
  140. /n3    LDnr            !Divide by #rows in display
  141. ! Add input layer probe
  142. =PNam    "_in_lay"        !Probe name
  143. =NPEl    0            !Input Layer
  144. @NrPE                !Point to it
  145. @PbAS                !Add Probe
  146. @PbDC                !Delete all components
  147. @PALy                !Add Near Layer to Probe
  148. !
  149. :BldInstr
  150. @ILdD                !load default instrument
  151. !
  152. !    *** Calculate # plots and #x ***
  153. !
  154. ! Defaults:
  155. !
  156. =Inpl    n4            !Default: Total # PEs in Probe
  157. =Ignx    n3            !Default: As defined above
  158. =ICAc    0            !No convergence criterion
  159. =ICTh    0.0            !Zero convergence threshold
  160. !
  161. ! RMS over layer is an exception to #plots:
  162. !
  163. ?EPVr    1            !RMS error over layer?
  164. >bne    NumPl1            !No
  165. >br    NumPl3
  166. ?EPVr    6            !RMS Weights over layer?
  167. >bne    NumPl1            !No
  168. :NumPl3
  169. ?EPPb    0            !Network Probe?
  170. >bne    NumPl2            !No
  171. =Inpl    n5
  172. -Inpl    1            !#layers - 1
  173. =Ignx    Inpl
  174. >br    NumPl1
  175. :NumPl2
  176. =Inpl    1
  177. =Ignx    1
  178. :NumPl1
  179. !
  180. !    *** Graph Type dependent stuff ***
  181. !
  182. !    *** STRIP CHARTS ***
  183. !
  184. ! #x for Strip charts is an exception:
  185. ?EPGr    0            !Strip chart?
  186. >bne    NotStrip        !No
  187. =Ignx    100            !Nominal # plot points
  188. =Ihgt    64            !Nominal Height
  189. =Iwdt    300            !Nominal Width
  190. ?EPEp    0            !Epoch Option?
  191. >bne    Strip1            !Yes
  192. =ILDv    10            !Nominal Learn Divisor
  193. :Strip1
  194. ! Set up convergence criterion if RMS Error strip
  195. ?EPVr    1            !RMS Error over layer?
  196. >bne    EndGType        !No
  197. ?EPPb    1            !Output layer?
  198. >bne    EndGType        !No
  199. =ICAc    1            !Activate convergence criterion
  200. =ICTh    0.001            !Low convergence threshold
  201. >br    EndGType
  202. !
  203. !    *** HISTOGRAMS ***
  204. !
  205. ! #plots for Histograms is an exception:
  206. :NotStrip
  207. ?EPGr    3            !Histogram?
  208. >bne    NotHisto        !No
  209. =Ignx    30            !Nominal # Bins
  210. =Ihgt    64            !Nominal Height
  211. =Iwdt    300            !Nominal Width
  212. =ILDv    5            !Nominal Learn Divisor
  213. ?EPEp    0            !Epoch Option?
  214. >bne    Histo1            !Yes
  215. =ILDv    20            !Nominal Learn Divisor
  216. :Histo1
  217. >br    EndGType
  218. !
  219. !
  220. !    *** CONFUSION MATRICES ***
  221. !
  222. ! #plots and #x for Confusion matrices are exceptions
  223. :NotHisto
  224. ?EPGr    4            !Confusion Matrix?
  225. >bne    NotConfM        !No
  226. =Ignx    9
  227. =Inpl    81
  228. =Ihgt    90            !Nominal Height
  229. =Iwdt    90            !Nominal Width
  230. =ILDv    5            !Every 5 Epochs
  231. ! Epoch is forced for Confusion matrix
  232. =EPEp    1            !Force epoch
  233. >br    EndGType
  234. !
  235. !
  236. !    *** BAR, MATRIX, HINTON ***
  237. !
  238. :NotConfM
  239. ! Try to set a good height and width
  240. =Iwdt    Ignx
  241. =Ihgt    Inpl
  242. /Ihgt    Ignx
  243. *Iwdt    10
  244. *Ihgt    10
  245. =n0    64
  246. ?Iwdt    n0
  247. >bgt    Bar1
  248. =Iwdt    n0
  249. :Bar1
  250. ?Ihgt    n0
  251. >bgt    EndGType
  252. =Ihgt    n0
  253. !
  254. :EndGType
  255. !
  256. !    *** Other Default stuff ***
  257. !
  258. =IEpc    EPEp            !Set epoch flag
  259. =ILnA    1            !Active in Learn
  260. =IRcA    0            !NOT Active in recall
  261. =IGTy    EPGr            !Graph Type
  262. =IGVr    "CurErr"        !Variable
  263. =ITTy    "RMS"            !RMS Transformation Type
  264. =ITMd    0            !No Transformation
  265. =IPrb    PNam            !Point to probe
  266. ! Use n2 to flag -ve vmin; this is a fairly complicated
  267. ! function of variable type, graph type and epoch option,
  268. ! so it is difficult to come up with a good default, and
  269. ! there are several exceptions below
  270. =n2    1            !Negative vmin
  271. ! Epoch, Non-Histogram graphs should have non-negative vmin
  272. ?EPEp    0            !Epoch Option?
  273. >beq    VMin1            !No
  274. ?EPGr    3            !Histogram?
  275. >beq    VMin1            !Yes
  276. ?EPGr    4            !Confusion Matrix?
  277. >beq    VMin1            !Yes
  278. =n2    0            !Non-Negative vmin
  279. :VMin1
  280. !
  281. !    *** Variable dependent stuff ***
  282. !    
  283. !    *** PE ERROR ***
  284. !
  285. ?EPVr    0            !PE Error?
  286. >bne    NotPEErr        !No
  287. =ITit    "PE Error"        !Instrument title
  288. =Ivmx    1.0            !Maximum plotted value
  289. >br    NotRMSLy
  290. !
  291. !    *** RMS ERROR ***
  292. !
  293. :NotPEErr
  294. ?EPVr    1            !RMS Error over layer?
  295. >bne    NotRMSEr        !No
  296. =ITit    "RMS Error"        !Instrument title
  297. =ITMd    2            !Transform over component
  298. =n2    0            !Always non-negative vmin
  299. =Ivmx    1.0            
  300. >br    NotRMSLy
  301. !
  302. !    *** OUTPUT VALUE ***
  303. !
  304. :NotRMSEr
  305. ?EPVr    2            !Output Value?
  306. >bne    NotOutpV        !No
  307. =ITit    "Output Value"        !Instrument title
  308. =IGVr    "Out"            !Plot Output
  309. =Ivmx    1.0            !Maximum plotted value
  310. =IRcA    1            !ACTIVE in recall
  311. ?n2    0            !potentially negative vmin?
  312. >beq    OutpV1            !No
  313. ?n7    0            !BiPolar Output?
  314. >bne    OutpV1            !Yes
  315. =n2    0            !Non-negative vmin
  316. :OutpV1
  317. >br    NotRMSLy
  318. !
  319. !    *** SUMMATION VALUE ***
  320. !
  321. :NotOutpV
  322. ?EPVr    3            !Summation Value?
  323. >bne    NotSumV            !No
  324. =ITit    "Summation Value"    !Instrument title
  325. =IGVr    "Sum"            !Plot Summation
  326. =Ivmx    3.0            !Maximum plotted value
  327. =IRcA    1            !ACTIVE in recall
  328. >br    NotRMSLy
  329. !
  330. !    *** INDIVIDUAL WEIGHT VALUE ***
  331. !
  332. :NotSumV
  333. ! Must be some sort of weight value. Set up default
  334. ! vmax and variable to be plotted
  335. =Ivmx    8.0
  336. =IGVr    "Weight"        !Plot Weight Value
  337. !
  338. ?EPVr    4            !Individual Weight Value?
  339. >bne    NotIndWt        !No
  340. =ITit    "Individual Weights"    !Instrument title
  341. >br    NotRMSLy
  342. !
  343. !    *** RMS WEIGHT VALUE OVER PE ***
  344. !
  345. :NotIndWt
  346. ?EPVr    5            !RMS Weight Value over PE?
  347. >bne    NotRMSPE        !No
  348. =ITit    "RMS Weights (PE)"    !Instrument title
  349. =n2    0            !Always non-negative vmin
  350. =ITMd    1            !Transform over node
  351. >br    NotRMSLy
  352. !
  353. !    *** RMS WEIGHT VALUE OVER LAYER ***
  354. !
  355. :NotRMSPE
  356. =EPVr    6            !FORCE RMS Weight Value over PE?
  357. =ITit    "RMS Weights (Layer)"    !Instrument title
  358. =n2    0            !Always non-negative vmin
  359. =ITMd    2            !Transform over component
  360. !
  361. :NotRMSLy
  362. !
  363. =Ivmn    0.0            !Minimum plotted value
  364. ?n2    0            !Signed vmin?
  365. >beq    AddInstr        !No
  366. -Ivmn    Ivmx            !Negative of vmax
  367. !
  368. :AddInstr            !Finally...
  369. @IAdd                !... add instrument
  370.