home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / DATAREP.ZIP / MANUAL.RNO < prev    next >
Encoding:
Text File  |  1990-02-22  |  39.2 KB  |  1,147 lines

  1. .page size 60
  2. .control characters
  3. ¢12m
  4. .left margin 5
  5. .right margin 90
  6. .b4
  7. .c
  8. How-To-Use-It-Manual
  9. .b2
  10. .c
  11. Stimulus Generation and Association Programs
  12. .b2
  13. .c
  14. Brown University Neural Modeling Group
  15. .b2
  16. .c
  17. Release 2.0
  18. .b
  19. .c
  20. BSB and ASSOCIATE 
  21. .b2
  22. .c
  23. March 29, 1989 
  24. .b6
  25. .c
  26. James A. Anderson
  27. .b2
  28. .c
  29. Department of Cognitive and Linguistic Sciences
  30. .b
  31. .c
  32. and
  33. .b
  34. .c
  35. Department of Psychology,
  36. .b4
  37. .c
  38. Brown University
  39. .b2
  40. .c
  41. Providence, RI 02912
  42. .b4
  43. .c
  44. (c) Copyright James A. Anderson, 1989
  45. .page
  46. .b2
  47. ^&Introduction.\&
  48. .p
  49. This manual will tell you how to use a set of programs developed
  50. at the Department of Cognitive and Linguistic
  51. Sciences, Brown University.
  52. The programs are research programs designed to generate, maintain,
  53. learn, and use sets of stimuli and matrices used in neural modelling
  54. research.  
  55. .p
  56. The programs are written in VMS Pascal to run on a VAX.
  57. There are two programs of major interest.  
  58. One is called
  59. ASSOCIATE and generates the matrices that associate pairs of
  60. vectors.  (Sometimes a version of this program that involved a file
  61. transfer through
  62. an MS/DOS system will name it ASSOC.  Same program.)
  63. Actually, the internal representation of a matrix
  64. is in the form of a FILE of a Pascal data type called Neuron,
  65. but acts mathematically like a matrix.
  66. The other is a program with several parts.  It is called
  67. BSB.  One part 
  68. generates stimuli which are large state vectors.  These state
  69. vectors represent strings of 25 characters in a 200 dimensional system.  
  70. Once generated,
  71. the state vectors can be associated together using ASSOCIATE.
  72. Another part realizes the dynamics of the simple non-linear
  73. model called the `Brain-state-in-a-Box'.   (See Anderson, Silverstein,
  74. Ritz and Jones, 1977, Anderson and Mozer, 1981; Anderson, 1986; and
  75. Anderson and Murphy, 1986) 
  76. .test page 12
  77. .b2
  78. ^&Files\&
  79. .p
  80. Several files must be ASSIGNed so the programs will know where to
  81. read and write the data.  Below is a set of ASSIGN statements
  82. in the appropriate form.  The example chosen is the file
  83. assignments from the `OHMS'
  84. demonstration, though the OHMS.COM file actually contains
  85. more material than this, since it also runs the demonstration.
  86. These VMS commands should be
  87. put in a command file (in this case, OHMS.COM) which
  88. makes the appropriate assignments for convenience.
  89. .literal
  90.  
  91.      $assign fohms.stm ffile
  92.      $assign gohms.stm gfile
  93.      $assign tohms.stm tfile
  94.      $assign nohms.neu nfile
  95.  
  96. .end literal
  97. Then execute the command file by typing _@OHMS to make the assignments.
  98. There are enough files to make life complicated unless some systematic
  99. way is found to label the files.
  100. .p
  101. By convention, the input and output vectors are given the extension
  102. `.STM' and the file containing the matrix are given the extension `.NEU'.  
  103. As a general point, the files constructed with these programs can
  104. be quite large.  In the 200 dimensional system the files associated
  105. with the matrix are 633 blocks long.  
  106. .test page 12
  107. .b2
  108. ^&Making the Stimuli using BSB.\&
  109. .p
  110. The first step in making 
  111. stimuli is to RUN BSB.  The program will ask you if you are
  112. using a VT100 or not.  (I am assuming you are in this manual.)
  113. Then some initial information appears.  The general pattern of
  114. displays in BSB is to have status information on the top 5
  115. lines of the screen and the command prompts on the bottom line.
  116. Since the author of these programs was influenced by UCSD Pascal
  117. at an impressionable age, extensive use is made of self documenting
  118. prompts.  For example, 'T)hreshold' means that if 'T' (or 't') is
  119. typed at the command prompt ('>') the threshold interpretation parameter can be
  120. changed from its default.  In general, typing a single letter, 
  121. followed by <Return> will
  122. cause an action.  All commands can be upper or lower case and most
  123. are protected to some extent (not totally!) against erroneous inputs.  Not all
  124. commands appear on the prompt lines, for reasons of space, particularly
  125. for setting some of the less frequently used parameters in the simulation.
  126. .p
  127. At first, there are no files present for BSB to work with.  
  128. Let us assume you want to create a series of stimuli for future use.
  129. The prompt line tells you how many stimuli are present in the
  130. F File, the G File, and the T File.  When the program first appears,
  131. these values are all zero.
  132. F File and G File have the customary meanings they have in our
  133. neural modelling literature: i.e. the F File is the input set of
  134. state vectors and the G File is the output set of state vectors.
  135. The T file contains a set of 'Test' vectors, usually partial input
  136. stimuli,  which are used to test
  137. the reconstructive and processing powers of the system.  
  138. .p
  139. Although this simple form of our programs only performs
  140. autoassociation, more complex versions can have different
  141. input and output sets.  
  142. .p
  143. Input vectors are constructed from strings of characters.
  144. We will assume the system is 200 dimensional.  
  145. A character in the string is represented by its ASCII number,
  146. i.e. 'a' is 97, '5' is 53, '=' is 61, and so on.
  147. These numbers are converted into binary representation, 
  148. so 'a' becomes '01100001'.  Then the zeros are replaced
  149. with minus ones, so we can maintain rough equality of numbers of positive
  150. and negative elements which is convenient for the models, so the
  151. actual internal representation of 
  152. .b
  153. .i10
  154. 'a' ---> -1,1,1,-1,-1,-1,-1,1.
  155. .p
  156. Each character
  157. requires 8 vector elements, so a 200 dimensional system contains
  158. enough elements for 25 characters.  The parity bit is
  159. computed but not used in the simulations at present.
  160. One reason for its presence, is that eight bits allow the
  161. construction of `orthogonal' character representations, which
  162. can sometimes be a convenience. 
  163. If anyone wanted to actually ^&use\& these programs for anything
  164. substatial it is ^&strongly recommended\& that a less arbitrary
  165. way of coding letters be used.   
  166. The state vectors contain single precision
  167. floating point numbers.  Currently no more than 100 stimuli
  168. are allowed in any one file but this can be easily changed in
  169. the programs if necessary. 
  170. .p
  171. The technically inclined might like to know that stimuli are
  172. a Pascal Record composed of two pieces:
  173. .test page 16
  174. .b
  175. .literal
  176.           CONST Dimensionality = 200;
  177.  
  178.           TYPE  Vector    = ARRAY [1..Dimensionality] OF REAL;
  179.  
  180.                 String    = PACKED ARRAY [1..60] OF CHAR;
  181.  
  182.                 Stimulus  = RECORD
  183.                             Name: String;
  184.                             Val : Vector;
  185.                             END;
  186.  
  187. .end literal
  188. .test page 30
  189. .b3
  190. .c
  191. Figure 1.  Initial appearance of the screen.
  192. .b
  193. .c
  194. ---------------------
  195. .b
  196. .literal
  197. BSB Neural Net Programs. 3-89  B)SB.  C)hange. E)xit. H)elp. 
  198. L)ist. M)ode. N)eurons. R)ead. S)ave. T)hreshold.  W)rite.
  199.  Threshold:  5.0E-01  F File:    0  G File:    0  T File:    0
  200. NO NEURON FILE.  Display TF. 
  201.  
  202. Initializing Files.
  203. Reading neuron and stimulus files from disk.
  204. Reading F file.
  205. Reading G file.
  206. Reading T file.
  207. Reading neuron file (autoassociative).
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216. C>
  217. .end literal
  218. .b
  219. .c
  220. ---------------------
  221. .b2
  222. .p
  223. The program will automatically look for the assigned stimulus
  224. and neuron files, and write its progress to the screen.  If
  225. it doesn't find a file, it will write 'Stimulus file not found'
  226. to the command line (i.e. the 'C>' line).  You may have to watch
  227. carefully to see this line appear, and then disappear when the
  228. next file is read.  The information at the top of the screen
  229. will also inform you of progress.  In the example, there are
  230. no stimuli in the F file, G file, and T file and this is noted
  231. in the third line on the screen.  There is also a comment
  232. that there is 'NO NEURON FILE' on the fourth line.
  233. .p
  234. To contruct a stimulus, type 'C' from the first command level.
  235. This allows you to 'C)hange' the stimuli in the Files, which currently
  236. contain no stimulus vectors.
  237. There are a number of options in 'C)hange' to allow you to 
  238. do various useful things to the stimuli.  
  239. .p
  240. Suppose you want to make a new stimulus, say the first stimulus
  241. in the F File.  Type 'R', for 'Replace.'  The program will then
  242. prompt you as to which stimulus to replace.  If you say 'F1',
  243. the F[1] position in the F File 
  244. (which starts off as all blanks) will be replaced
  245. with what you type and the appropriate state vector will be
  246. constructed.  Figure 2 shows the screen after the contents
  247. of several vectors (f1, f2, and f3) have been replaced with
  248. ASCII character strings and f4 is about to be replaced.  The
  249. names of f1, f2 and f3 were listed and appear in the center of
  250. the screen. 
  251. .b3
  252. .test page 30
  253. .c
  254. Figure 2. Appearance after several f stimuli are made.
  255. .b
  256. .c
  257. --------------------
  258. .b
  259. .literal
  260. Template: 1234567890123456789012345
  261. New     : This will be f4.
  262.  
  263.  
  264.  
  265.  
  266.  
  267.    F[ 1].  This is stimulus f1.____  G[ 1].
  268.    F[ 2].  This is stimulus f2.____  G[ 2].
  269.    F[ 3].  And this is f3._________  G[ 3].
  270. .end literal
  271. .b13
  272. Replace which stimulus (set, number) : f4
  273. .b
  274. .c
  275. --------------------
  276. .b2
  277. .p
  278. After you choose the stimulus to replace, 'Template:' will
  279. appear at the top of the screen.  This is a set of 25 digits
  280. to serve as a reference marks for constructing your stimulus.
  281. Underneath it is 'New_ _ _ _ _ :' which is where the cursor is
  282. and where you can write the new string.  Any ASCII character except
  283. '__'can be placed here and will be represented as its appropriate byte.  
  284. The ASCII character '__' is represented in the vector
  285. as all zeros.  If you hit return before the end of the
  286. string, the vector will be filled out with zeros, represented
  287. as underlines.  If you type in more than 25 characters, the
  288. excess will be ignored.  Remember to use <Delete> to remove
  289. characters from a line, as you always do on DEC systems.  Using
  290. the <Backspace> key will insert non-printing control characters into the
  291. line, causing erratic behavior of the system that is difficult to detect.
  292. .p
  293. After you have typed in a few stimuli, you can see the
  294. current set by typing 'L' for 'L)ist'.  This will 
  295. list either the F file and the G File or the T file
  296. and the F file, depending on which M)ode you have
  297. chosen.  If there are more stimuli than will fit on the screen
  298. you can move the file B)ackwards or F)orwards by typing 'b' or 'f'.
  299. Typing any other letter will return you to where you were.  The
  300. listing will remain on the screen for reference until new information
  301. has to be written over it.
  302. .left margin 10
  303. .p
  304. Briefly the commands in C)hange are:
  305. .p
  306. A)dd.  Form a state vector as the sum of other state vectors.
  307. The resulting vector values are divided by the number in the
  308. sum (i.e. the average of the vectors is taken).  The '.Name'
  309. of this type of state vector will appear in the L)isting
  310. as, for example,  'Sum f01 f02 f03' if it was the sum of
  311. stimulus vectors F[1], F[2], and F[3].  Up to 16 vectors can
  312. be summed. 
  313. .p
  314. C)opy.  Copy a state vector in one location to another
  315. location.  The program will prompt you for the stimulus to
  316. be copied and where to put it.
  317. .p
  318. E)dit.  This useful command will let you 'edit'
  319. an already existing stimulus.  It will ask you for the
  320. stimulus number to edit.  It will then give the old stimulus
  321. as the template and let you type in the new stimulus 
  322. right below it.  When you
  323. type <Return> the new stimulus vector will replace the old one.  
  324. .p
  325. I)ndividual values.  Will show the individual element values.
  326. The elements arranged on a byte per line with the number of
  327. the first and last elements on the line numbered on left and
  328. right sides of the screen, and the ASCII interpretation of
  329. the byte on the left.  This command has its own command
  330. line.
  331. .left margin 15
  332. .p
  333. C)hoose chooses which vector to show.
  334. .p
  335. D)isplay displays the elements.
  336. .p
  337. M)ode (see below). 
  338. .p
  339. Q)uit returns to C)hange.
  340. .p
  341. T)hreshold (see below).
  342. .p
  343. X)change allows you to change individual values.
  344. .left margin 10
  345. .p
  346. L)ist.  Lists the state vectors in the files.  If the display
  347. is in FG mode, the F File and the G File will be listed.
  348. If the display is in T mode, the T File and the F File
  349. will be listed.  If more than 16 vectors are present,
  350. only sixteen at a time will be shown.  The 16 stimuli displayed can
  351. be shifted forward or backward by typing 'F' or 'B'.  L)ist can
  352. be left by typing any character other than 'F' or 'B'. 
  353. .p
  354. M)ode.  Change listing mode from displaying the F File and the G File to
  355. displaying the T File and the F File or vice versa.
  356. .p 
  357. Q)uit.  Return to wherever you entered C)hange from.
  358. C)hange can also be entered from BSB.
  359. .p
  360. R)eplace.  Replace a member of one of the files with
  361. a new stimulus.  
  362. .p
  363. S)ave.  Save the file of stimuli to a disk file.  The
  364. program will prompt you as to which file(s) you want to
  365. save.  The saved file will be given the names you
  366. ASSIGNed to it earlier.  If there is already a
  367. file of that name present, VMS will give the new
  368. file a later version number.  For example,  if F15.STM;2 is
  369. the ASSIGNed initial stimulus file, if you S)ave a later version
  370. of the file, it will get the name F15.STM;3, and so on.  If you
  371. purge your directory, you will delete the earlier versions
  372. of the stimulus file.
  373. Don't forget to S)ave your work!
  374. .p
  375. >>>^&The program does NOT automatically save new stimuli.\&<<<
  376. .p
  377. T)emplate. Sometimes it is convenient to use
  378. a template other than digits to make remembering what goes
  379. where easier.  T)emplate allows
  380. you to make your own string of ASCII characters to serve as a
  381. template, or to
  382. use a member of one of the Stimulus files as a model for a template.
  383. .test page 12
  384. .left margin 5
  385. .b2
  386. ^&Using ASSOCIATE to Make a New Learning Matrix.\&
  387. .p
  388. Suppose you have constructed a set of F and G stimuli.
  389. You have saved them to appropriate disk files, and now
  390. wish to form the association matrix between the input and
  391. output sets.  This is done with the program named ASSOCIATE.
  392. ASSOCIATE can take sizeable amounts of computer time, so be
  393. careful!  To learn a set of 12 200 dimensional vectors
  394. using the Widrow-Hoff error correction procedure for a total
  395. of 500 presentations can take 10 to 15 minutes of VAX CPU time, even
  396. if the system is partially connected.
  397. Also the data files ASSOCIATE automatically creates to store the results
  398. are very large (633 blocks in a 200 dimensional system) so
  399. be sure you have enough free space in your directory to write
  400. such a large file, otherwise the results of all the computing
  401. may be lost.
  402. .p
  403. If you RUN ASSOCIATE, first the F and G files will be listed
  404. so you can see if they are satisfactory.  
  405. A listing of a session using ASSOCIATE to generate an Association matrix
  406. follows.
  407. The data set is a set of ambiguous descriptors used in the
  408. disambiguation demonstration.
  409. .page
  410. .literal
  411. ASSOCIATE program.  March 19, 1989.
  412.  
  413. The program is reading the FFILE.
  414. The dimensionality of the system is 200
  415.  
  416. The program is reading the GFILE.
  417.  
  418. F and G stimuli used.
  419.  
  420.  F[ 1] : BaseballGameBat BallDiamd
  421.  G[ 1] : BaseballGameBat BallDiamd
  422.  
  423.  F[ 2] : Vampire MythBat NiteDracu
  424.  G[ 2] : Vampire MythBat NiteDracu
  425.  
  426.  F[ 3] : Animal  LiveBat WingFlyng
  427.  G[ 3] : Animal  LiveBat WingFlyng
  428.  
  429.  F[ 4] : Poker   GameBeerTablCards
  430.  G[ 4] : Poker   GameBeerTablCards
  431.  
  432.  F[ 5] : Tennis  GameCortBallRackt
  433.  G[ 5] : Tennis  GameCortBallRackt
  434.  
  435.  F[ 6] : Dancing RichPrtyBallSocty
  436.  G[ 6] : Dancing RichPrtyBallSocty
  437.  
  438.  F[ 7] : GeoShapeTwoDCrclSqreDiamd
  439.  G[ 7] : GeoShapeTwoDCrclSqreDiamd
  440.  
  441.  F[ 8] : GeoModelTreDSphrBallTetra
  442.  G[ 8] : GeoModelTreDSphrBallTetra
  443.  
  444.  F[ 9] : ExpJewelRichRubyOpalDiamd
  445.  G[ 9] : ExpJewelRichRubyOpalDiamd
  446.  
  447. Seed for RN generator           : 123123
  448. Number of associations to learn : 100
  449. Use CORRECTION procedure? Y or N: y
  450. Use old Nfile as start? Y or N  : n
  451. Number of synapses              : 100
  452. Setup completed.
  453.  
  454.    10  Nr:    8   Cosine:  5.16E-01
  455.    20  Nr:    5   Cosine:  9.01E-01
  456.    30  Nr:    4   Cosine:  9.48E-01
  457.    40  Nr:    1   Cosine:  9.60E-01
  458.    50  Nr:    2   Cosine:  9.25E-01
  459.    60  Nr:    6   Cosine:  9.47E-01
  460.    70  Nr:    5   Cosine:  9.87E-01
  461.    80  Nr:    2   Cosine:  9.74E-01
  462.    90  Nr:    4   Cosine:  9.97E-01
  463.   100  Nr:    3   Cosine:  9.70E-01
  464.  
  465. Accuracy of recall of input set.
  466.  
  467.   1  Name: BaseballGameBat BallDiamd 
  468.   Cosine:  9.80E-01  Length:  1.30E+01
  469.  
  470.   2  Name: Vampire MythBat NiteDracu 
  471.   Cosine:  9.93E-01  Length:  1.27E+01
  472.  
  473.   3  Name: Animal  LiveBat WingFlyng 
  474.   Cosine:  9.84E-01  Length:  1.28E+01
  475.  
  476.   4  Name: Poker   GameBeerTablCards 
  477.   Cosine:  9.97E-01  Length:  1.36E+01
  478.  
  479.   5  Name: Tennis  GameCortBallRackt 
  480.   Cosine:  9.78E-01  Length:  1.21E+01
  481.  
  482.   6  Name: Dancing RichPrtyBallSocty 
  483.   Cosine:  9.94E-01  Length:  1.33E+01
  484.  
  485.   7  Name: GeoShapeTwoDCrclSqreDiamd 
  486.   Cosine:  9.70E-01  Length:  1.16E+01
  487.  
  488.   8  Name: GeoModelTreDSphrBallTetra 
  489.   Cosine:  9.97E-01  Length:  1.33E+01
  490.  
  491.   9  Name: ExpJewelRichRubyOpalDiamd 
  492.   Cosine:  9.93E-01  Length:  1.33E+01
  493.  
  494. Writing to neuron output file.
  495. .end literal
  496. .page
  497. .p
  498. The Prompts are mostly  self explanatory.
  499. .p
  500. 1.  Seed starts off the random number generator.
  501. Pairs of associations from the 
  502. set of stimulus pairs are presented randomly.  A 
  503. particular sequence can be repeated if the same seed is
  504. used. 
  505. .p
  506. 2.  The number to be learned depends on the number of
  507. items in the stimulus sets.  If the Widrow-Hoff error correction
  508. procedure is used, about 30 presentations per pair
  509. is a good place to start.  If the linear associator
  510. is used, only one presentation of each pair
  511. is necessary.
  512. .p
  513. 3.  Correction Procedure.  If 'Y' or 'y', the Widrow-Hoff
  514. error correction procedure will be used, otherwise, the
  515. linear associator without error correction will be used.
  516. .p
  517. 4.  Used Assigned Ninfile.  If 'Yes', a previously constructed
  518. neuron file will be used as a starting point, otherwise all
  519. matrix elements start off at zero. You can
  520. teach an old matrix new tricks if you wish.  If 'No', then
  521. a new matrix will be created.
  522. .p
  523. 5.  Number of synapses is the number of non-zero synapses
  524. in the matrix.  The rest of the synapses are set identically
  525. to zero.  Execution speed is a linear function of number
  526. of synapses because of the way the programs are written and the
  527. files are constructed.  This is
  528. because the matrices are not stored as matrices but as lists of non-zero
  529. synaptic connections.  Fewer synapses means less computation time.
  530. Usually 50% connectivity is adequate for most
  531. systems we have investigated up to now and seems to make the 
  532. systems work better than full connectivity, for reasons we
  533. now have some insight into.    
  534. It takes a while to set up the matrix, so expect a wait.
  535. If you set a connectivity of over 75%, you will get a warning
  536. message, telling you to expect a VERY long wait.  However,
  537. 100% connectivity is handled separately, and sets up very fast.
  538. .p
  539. After the matrix is set up and the system starts learning,
  540. the program will print out a progress report every
  541. 10 presentations.  It will tell you the cumulative number
  542. of trials, the stimulus pair presented that trial, and the
  543. cosine between obtained and desired output vectors, so
  544. you can check on progress and make sure the stimuli are
  545. being presented correctly.  After learning is over,
  546. the program will test how well the system learned.
  547. It will take each F in the F File in turn as input, compute the
  548. output, and compare that output with the correct
  549. association by computing the cosine between the actual and
  550. correct answers.  A cosine of 1.0 is perfect.  The length of
  551. the vectors is also computed.  The
  552. new neuron file will then be written to whatever file
  553. is ASSIGNed to Noutfile.  Remember, in a 200 dimensional system,
  554. these files are 633 blocks long so make sure you have enough
  555. free space in your account.
  556. .test page 12
  557. .b2
  558. ^&Using the Matrix.\&
  559. .p
  560. To test the behavior of a previously constructed
  561. matrix, RUN BSB.
  562. .p
  563. You must read in the matrix and the stimulus sets you
  564. wish to test.  This is done automatically in BSB.
  565. The program will inform you of its progress and whether
  566. or not it found the ASSIGNed files.  Success or failure
  567. in retrieving files will appear on the status line
  568. (i.e. the bottom line).  This line will appear and disappear
  569. so you have to watch carefully if you are interested.
  570. The status box (the top five lines) will tell
  571. you how many stimuli are in the
  572. stimulus files (0 if the files were not present)
  573. and whether
  574. neuron files are present.  (See Figure 1.)  
  575. .p
  576. If the program cannot
  577. find the required files, it will tell you,
  578. but will not stop the program.  Some other input errors
  579. may abnormally terminate the program and you will get a VMS error message.
  580. If you exit the program abnormally, by hitting <CTRL>C, or if you
  581. manage to do something fatal to the input, expect problems.
  582. Since your terminal has been reset to allow for the convenient display format,
  583. strange things may have happpened to your display, like
  584. having all input and output appear on one line.  You can
  585. either write a small program to reset your terminal to normal or
  586. run BSB again and simply type 'e' to E)xit from the program
  587. normally which will reset your VT-100.  
  588. A useful short program is called RESET which will reset your terminal
  589. after an abnormal exit from ITERATE:
  590. .test page 8
  591. .literal
  592.  
  593.      PROGRAM Reset (Input, Output);           {Resets terminal.}
  594.      BEGIN   {Reset.}
  595.      WRITE (CHR(27), '[1;24r');               {Restore_scrolling.}
  596.      WRITE (CHR(27), '[f', CHR (27), '[2J');  {Clear_screen.}
  597.      END.    {Reset.} 
  598. .end literal
  599. .test page 12
  600. .b2
  601. ^&The Brain State in a Box Model.\&
  602. .p
  603. To use the Brain-State-in-a-Box (BSB) Model, type 'B', for B)SB.
  604. There now appear new prompt and command lines.  There are a 
  605. number of parameters of the simulation which can be changed if necessary, 
  606. but the
  607. system comes with appropriate defaults for general use.  
  608. .p
  609. Figure 3 shows the appearance of the initial BSB screen.
  610. .b2
  611. .test page 30
  612. .b
  613. .c
  614. Figure 3.  Initial appearance of BSB Screen
  615. .b
  616. .c
  617. --------------------
  618. .b
  619. .literal
  620. BSB>P)asses :  16     U)Limit: 1.3E+00  T)hreshold: 5.0E-01   Stim. #) : T 1
  621. Mx: Synapses:  95   F)eedback: 7.0E-01      D)ecay: 6.5E-01    
  622. RESTART         
  623. .end literal
  624. .b17
  625. TF BSB Mx 1) 2) B)oth X)cute C)hange L)ist R)estart V)als Q)uit > 
  626. .b
  627. .c
  628. --------------------
  629. .b
  630. .p
  631. The variable x is the system state vector.
  632. The actual equation being used is
  633. .b
  634. .i5
  635.       x(t + 1) = Decay * x(t) + Feedback * A x(t) + {f(0)}.
  636. .b
  637. Decay is a decay parameter which measures the length of
  638. duration of the `short term memory' of the system.  (If there was
  639. no feedback, activity would decay geometrically, since this
  640. fraction is usually less than one.) 
  641. Feedback is a parameter multiplying the feedback through the
  642. matrix. 
  643. .p
  644. If it is enabled, the term {f(0)} 
  645. will add the initial state vector to the state vector at
  646. every step.  
  647. It could correspond to a continous input from an earlier
  648. processing stage.
  649. This is related to what is called 'clamping' in the Boltzmann
  650. machine literature and effectively holds non-zero input vector elements
  651. constant so they cannot change in later iterations.  This option is
  652. used in the DRUGS simulation.  It is enabled if 'O' or 'o' is typed
  653. from the command line.  
  654. .p
  655. The possible commands in the BSB system are:
  656. .left margin 10
  657. .p
  658. C)hange.  Change the state vectors in the F File, G File or T File.
  659. (see earlier description of this part of the program).
  660. .p
  661. D)ecay allows change of the decay constant in the above equation. 
  662. .p
  663. F)eedback allows change of the feedback constants in the above equation.  
  664. .p
  665. L)ist.  List the vectors in the files.  If the display
  666. is in FG mode, the F File and the G File will be listed.
  667. If the display is in T mode, the T File and the F File
  668. will be listed.  If more than 16 vectors are present,
  669. only sixteen at a time will be shown.  The part displayed can
  670. be moved forward or backward by typing 'F' or 'B'.  L)ist can
  671. be left by typing any character other than 'F' or 'B'. 
  672. .p
  673. M)ode.  Changes the files L)isted from F and G to T and F or
  674. vice versa.  
  675. .p
  676. O)riginal stimulus.  This option adds the original stimulus
  677. vector to each iteration.  It is closely related to
  678. what is called `clamping' in the Boltzmann machine
  679. literature since it effectively ensures that initial values
  680. never decay away but are always present at high
  681. amplitude.  A comment will appear on the fifth
  682. line of the display if this option is in effect.
  683. If O) is typed again, the option is cancelled and the
  684. original stimulus will not be added.
  685. .p
  686. P)asses.  The number of iterations to be performed before
  687. the command line returns and you can cease iterations or
  688. change parameters.  The default value for P)asses
  689. is 16, the number of lines on the scrolling portion of the
  690. CRT screen.
  691. .p
  692. Q)uit.  Return to the highest command level.
  693. .p
  694. R)estart the simulation with the initial stimulus.  Otherwise
  695. typing X)cute will simply have the program continue what it was doing.
  696. The left part of the fourth status line will say RESTART is
  697. the system will start from zero iterations.  Otherwise, the
  698. number of completed iterations will appear here.
  699. .p
  700. T)hreshold allows change of the interpretation threshold.
  701. When the output of the equation above is generated it is simply
  702. a 200 dimensional vector of floating point numbers.  In order
  703. to see what it is actually doing, this vector is interpreted,
  704. i.e. turned back into an ASCII string.  This is done by
  705. letting every value greater than +Threshold be give value +1 and
  706. every value less than -Threshold be given value -1.  Values
  707. nearer to zero than plus or minus threshold are considered
  708. uninterpretable, and this particular byte is interpreted as
  709. the zero character, '__'.  Non-printing characters are
  710. represented as '_#'.  This thresholding algorithm is only
  711. for the operator's convenience (i.e. it eliminates  low amplitude
  712. ASCII garbage from the interpretations and makes them easier
  713. to read) and it has no effect on the
  714. values in the vector that are used for the next iteration.  The parity
  715. bit is not used in the interpretation and it is not checked for
  716. correctness.
  717. .p
  718. U)limit.  Allows change of the upper and lower limits in the
  719. BSB equation.
  720. Note upper and lower limit need not be the same.
  721. .p
  722. V)alues.  Will display the values of the current state vector
  723. in terms of tenths of upper or lower limit.  If the value is 
  724. equal to the upper or lower limit, +L or -L will appear.
  725. A digit refers to tenths of the appropriate limit, i.e.
  726. +5 means that the value of that element is between 0.5 and 0.6
  727. of the upper limit.  
  728. .p
  729. X)cute.  Start iterating the current state vector 
  730. for P)asses iterations.  Will continue
  731. from where it stopped if not R)eset.
  732. .p
  733. _#) allows choice of the stimulus number  to be used for staring
  734. the iterations if the system is R)eset.
  735. .left margin 5
  736. .page
  737. .b2
  738. ^&Examples\&
  739. .p
  740. Several examples of iterations using the matrices generated
  741. by a disambiguation simulation
  742. are shown next.
  743. Figure 5 shows the pairs of associations.
  744. Figure 6 shows the results of the first
  745. 16 iterations and the next 16 iterations  on 'bat ball'.
  746. Figure 7 shows the results of the first 16 and second
  747. 16 iterations on 'bat nite'.  (The common word, 'bat', is
  748. ambiguous and the context is able to choose the correct
  749. meaning. More details are given in Anderson and Murphy, 1986.)
  750. .p
  751. 'Check' refers to the number
  752. of element values equal to the Upper or Lower limit and is a rough
  753. measure of the length of the vector and how rapidly the vector
  754. is changing.  Positive feedback rapidly
  755. increases the number of saturated elements.
  756. .page
  757. .c
  758. Figure 5.  
  759. .c
  760. Stimulus Set for Disambiguation Example 
  761. .b
  762. .c
  763. --------------------
  764. .literal
  765. BSB Neural Net Program. 3-89   B)SB.  C)hange. E)xit. H)elp.
  766. L)ist. M)ode. N)eurons. R)ead. S)ave. T)hreshold.  W)rite.  
  767. Threshold:  5.0E-01  F File:    9  G File:    9  T File:   40
  768. Synapses :  100  Display FG.
  769.  
  770.    F[ 1]. BaseballGameBat BallDiamd   G[ 1]. BaseballGameBat BallDiamd
  771.    F[ 2]. Vampire MythBat NiteDracu   G[ 2]. Vampire MythBat NiteDracu
  772.    F[ 3]. Animal  LiveBat WingFlyng   G[ 3]. Animal  LiveBat WingFlyng
  773.    F[ 4]. Poker   GameBeerTablCards   G[ 4]. Poker   GameBeerTablCards
  774.    F[ 5]. Tennis  GameCortBallRackt   G[ 5]. Tennis  GameCortBallRackt
  775.    F[ 6]. Dancing RichPrtyBallSocty   G[ 6]. Dancing RichPrtyBallSocty
  776.    F[ 7]. GeoShapeTwoDCrclSqreDiamd   G[ 7]. GeoShapeTwoDCrclSqreDiamd
  777.    F[ 8]. GeoModelTreDSphrBallTetra   G[ 8]. GeoModelTreDSphrBallTetra
  778.    F[ 9]. ExpJewelRichRubyOpalDiamd   G[ 9]. ExpJewelRichRubyOpalDiamd
  779.  
  780.  
  781.  
  782.  
  783.  
  784. C>
  785. .end literal
  786. .c
  787. --------------------
  788. .page
  789. .c
  790. Figure 6. 
  791. .c
  792. Bat and Ball After 16 and 32 Iterations
  793. .b2
  794. .c
  795. --------------------
  796. .b
  797. .literal
  798.  
  799. BSB>P)asses :  16     U)Limit: 1.3E+00  T)hreshold: 5.0E-01   Stim. #) : t 5
  800. Mx: Synapses: 100   F)eedback: 2.0E-01      D)ecay: 9.0E-01
  801. RESTART
  802.  
  803.      1.  ____________Bat Ball_____  Check:   0
  804.      2.  ____________Bat Ball_____  Check:   0
  805.      3.  ____________Bat Ball_____  Check:   0
  806.      4.  ____________Bat Ball_____  Check:   1
  807.      5.  ____________Bat Ball_____  Check:   5
  808.      6.  ____________Bat Ball_____  Check:  10
  809.      7.  _a__________Bat Ball_____  Check:  14
  810.      8.  _a__________Bat Ball_____  Check:  16
  811.      9.  _a__________Bat Ball_____  Check:  21
  812.     10.  _a__________Bat Ball_____  Check:  25
  813.     11.  _a_e________Bat Ball__a__  Check:  45
  814.     12.  _a_e________Bat Ball__a__  Check:  56
  815.     13.  _a_e_______eBat Ball__a__  Check:  67
  816.     14.  _a_e_______eBat Ball__a__  Check: 105
  817.     15.  Ba_e____G__eBat Ball__a__  Check: 108
  818.     16.  Ba_e____G__eBat Ball__a__  Check: 116
  819.  
  820. TF BSB X)ecute C)hange L)ist R)estart V)als Q)uit > 
  821. .end literal
  822. .c
  823. --------------------
  824. .b2
  825. .c
  826. --------------------
  827. .b
  828. .literal
  829. BSB>P)asses :  16     U)Limit: 1.3E+00  T)hreshold: 5.0E-01   Stim. #) : t 5
  830. Mx: Synapses: 100   F)eedback: 2.0E-01      D)ecay: 9.0E-01
  831. It:  16
  832.  
  833.     17.  Ba_e____G__eBat Ball__a__  Check: 124
  834.     18.  Ba_e____G__eBat Ball__a__  Check: 129
  835.     19.  Ba_e____Ga_eBat Ball__a__  Check: 135
  836.     20.  Ba_e____Ga_eBat Ball__a__  Check: 138
  837.     21.  Ba_e____Ga_eBat BallD_a__  Check: 144
  838.     22.  Ba_e__l_Ga_eBat BallDia__  Check: 149
  839.     23.  Ba_e__l_Ga_eBat BallDia__  Check: 154
  840.     24.  Ba_e__l_GameBat BallDia__  Check: 159
  841.     25.  Base__llGameBat BallDiam_  Check: 161
  842.     26.  Base__llGameBat BallDiam_  Check: 170
  843.     27.  Baseb_llGameBat BallDiam_  Check: 174
  844.     28.  BaseballGameBat BallDiamd  Check: 179
  845.     29.  BaseballGameBat BallDiamd  Check: 181
  846.     30.  BaseballGameBat BallDiamd  Check: 187
  847.     31.  BaseballGameBat BallDiamd  Check: 192
  848.     32.  BaseballGameBat BallDiamd  Check: 197
  849.  
  850. TF BSB X)ecute C)hange L)ist R)estart V)als Q)uit >
  851. .end literal
  852. .c
  853. --------------------
  854. .page
  855. .c
  856. Figure 7
  857. .c
  858. Bat and Nite after 16 and 32 Iterations
  859. .b
  860. .c
  861. --------------------
  862. .b
  863. .literal
  864. BSB>P)asses :  16     U)Limit: 1.3E+00  T)hreshold: 5.0E-01   Stim. #) : t16
  865. Mx: Synapses: 100   F)eedback: 2.0E-01      D)ecay: 9.0E-01
  866. RESTART
  867.  
  868.  
  869.      1.  ____________Bat Nite_____  Check:   0
  870.      2.  ____________Bat Nite_____  Check:   0
  871.      3.  ____________Bat Nite_____  Check:   0
  872.      4.  ____________Bat Nite_____  Check:   0
  873.      5.  ____________Bat Nite_____  Check:   0
  874.      6.  ____________Bat Nite_____  Check:   1
  875.      7.  ____________Bat Nite_____  Check:   4
  876.      8.  ____________Bat Nite_____  Check:  10
  877.      9.  ________M___Bat Ni_eD____  Check:  21
  878.     10.  _a______M___Bat Ni_eD____  Check:  24
  879.     11.  _a______M_t_Bat Ni_eD_a__  Check:  31
  880.     12.  _a_____ M_t_Bat Ni_eD_a__  Check:  51
  881.     13.  _a_____ M_t_Bat Ni_eD_a__  Check:  71
  882.     14.  _a_____ M_t_Bat Ni_eD_a__  Check: 100
  883.     15.  _a_____ M_t_Bat Ni_eD_a__  Check: 119
  884.     16.  _a_____ M_t_Bat Ni_eD_a__  Check: 123
  885.  
  886. TF BSB X)ecute C)hange L)ist R)estart V)als Q)uit > 
  887. .end literal
  888. .c
  889. --------------------
  890. .b2
  891. .c
  892. --------------------
  893. .b
  894. .literal
  895. BSB>P)asses :  16     U)Limit: 1.3E+00  T)hreshold: 5.0E-01   Stim. #) : t16
  896. Mx: Synapses: 100   F)eedback: 2.0E-01      D)ecay: 9.0E-01
  897. It:  16
  898.  
  899.     17.  _a__i__ M_t_Bat NiteD_a__  Check: 127
  900.     18.  _am_i_e Myt_Bat NiteD_a__  Check: 141
  901.     19.  _am_i_e MythBat NiteD_ac_  Check: 147
  902.     20.  _ampire MythBat NiteDracu  Check: 158
  903.     21.  Vampire MythBat NiteDracu  Check: 166
  904.     22.  Vampire MythBat NiteDracu  Check: 169
  905.     23.  Vampire MythBat NiteDracu  Check: 171
  906.     24.  Vampire MythBat NiteDracu  Check: 173
  907.     25.  Vampire MythBat NiteDracu  Check: 180
  908.     26.  Vampire MythBat NiteDracu  Check: 193
  909.     27.  Vampire MythBat NiteDracu  Check: 199
  910.     28.  Vampire MythBat NiteDracu  Check: 200
  911. >> Fully limited. Finished.
  912.  
  913.  
  914.  
  915.  
  916.  
  917. TF BSB X)ecute C)hange L)ist R)estart V)als Q)uit > 
  918. .end literal
  919. .c
  920. --------------------
  921. .page 
  922. .b2
  923. ^&Programming the System.\&  
  924. .p
  925. The system as described is primarily interactive.  However, it
  926. is often convenient, when doing a systematic study of a system,
  927. to look at a great many test vectors.  This release of
  928. the programs does not allow non-interactive programming.
  929. However, VMS command files will allow you to do this conveniently
  930. from outside the program.  Command files are files of
  931. system and program commands that are automatically executed
  932. when prefaced with '_@'.  System commands are preceded with
  933. '_$' and lines to serve as input to a program are simply
  934. typed. 
  935. .p
  936. Suppose we had a set of say, five test stimuli, an autoassociative
  937. system, and we wished to
  938. iterate every test stimulus 50 times and save the
  939. output of the program for future study.  Figure  8 shows
  940. a simple command file to accomplish this.  This command
  941. file expects to find all the appropriate files in
  942. the directory drb2:[anderson.code].
  943. .p
  944. The first lines make all the assignments, and since they are
  945. system commands they are preceded by a _$.  
  946. .p
  947. The line 
  948. .b
  949. .i10
  950. $assign drb2:[anderson.code]all159.out sys$output 
  951. .b
  952. assigns the output from the program to a file all159.out which
  953. can be typed or studied with a text editor. 
  954. .p
  955. Then BSB is run and the next lines form input to the
  956. program.  We are not using a VT100, so the first line is
  957. n)o.  Then the input files are l)isted.  We want
  958. to use the b)sb model.
  959. In this case, we want each p)ass to consist of 50 iterations
  960. and the o)riginal input vector to be added after
  961. each iteration.  Then test stimuli #'s t1 through t5 are successively
  962. x)ecuted, the system being r)eset after each new test stimulus.
  963. Then b)sb is q)uit and the program e)xited.
  964. .p
  965. The output will be found in drb2:[anderson.code]all159.out.
  966. .p
  967. This convenient technique allows large studies and parameter
  968. variants to be run in batch mode as well by using
  969. the VMS SUBMIT command with
  970. the command file.  
  971. .test page 45
  972. .c
  973. Figure 8
  974. .b
  975. .literal
  976. $set default drb2:[anderson.code]
  977. $assign f159.stm ffile
  978. $assign g159.stm gfile
  979. $assign ti159.stm tfile
  980. $assign n159.neu nfile
  981. $assign [anderson.test]all159.out sys$output 
  982. $run bsb 
  983. n
  984. l
  985. m
  986. l
  987. b
  988. p
  989. 50
  990. o
  991. #
  992. t1
  993. x
  994. r
  995. #
  996. t2
  997. x
  998. r
  999. #
  1000. t3
  1001. x
  1002. r
  1003. #
  1004. t4
  1005. x
  1006. r
  1007. #
  1008. t5
  1009. x
  1010. r
  1011. q
  1012. e
  1013. .end literal
  1014. .b2
  1015. Demonstration Command Files
  1016. .p
  1017. Because it is sometimes convenient to be able to regenerate
  1018. matrices or make stimulus files, we have provided command
  1019. files for three demonstrations. 
  1020. .p
  1021. We have already given examples of one demonstration, on
  1022. lexical disambiguation.  
  1023. There are two other neural net demonstrations available. 
  1024. One is
  1025. a simple drug data base, which contains information about drugs,
  1026. diseases and microorganisms.
  1027. There is also a demonstration
  1028. of an associative system learning Ohm's Law, which can
  1029. 'reason' about functional dependencies.
  1030. .p
  1031. Each of the demonstrations has three command files associated with it:
  1032. .test page 20
  1033. .literal
  1034.  
  1035. Demonstration   Generates                  Generates                Runs 
  1036.                 Matrix                     Stimuli                  Demo
  1037.                 (.neu files)               (.stm files)
  1038.                 (Uses ASSOCIATE)           (Uses BSB)               (Uses BSB)
  1039.  
  1040.  
  1041. Disambiguation: learndisambiguation.com     makedisambiguation.com   disambiguation.com
  1042.  
  1043. Ohm's Law:      learnohms.com               makeohms.com             ohms.com
  1044.  
  1045. Drug data base: learndrugs.com              makedrugs.com            drugs.com
  1046.  
  1047. .end literal
  1048. (Sometimes these command files may have shorter file names,
  1049. by an obvious transformation, such as,
  1050. learndrugs.com = ldrugs.com.  Some operating systems do not accept
  1051. long file names.)
  1052. It may take 10 or 20 minutes of MicroVAX CPU time to make the 
  1053. connection matrices, so beware!  Making the stimulus files
  1054. is quite rapid.  The command files are basically
  1055. strings of keystrokes, and it may be of some value to have complete working
  1056. `scripts' for some common operations of BSB and ASSOCIATE
  1057. .p
  1058. Ohms and Drugs are described at length in a manuscript
  1059. entitled `DEMOS.RNO' (the RUNOFF formatted source) and
  1060. `DEMOS.MEM',  the final version, which is complete with escape sequences
  1061. for an LA-100 printer.
  1062. It contains most of the
  1063. material presented in the demonstrations.  
  1064. A compressed version of this manuscript
  1065. appeared in 
  1066. (Anderson, 1986).
  1067. .b2
  1068. .c
  1069. Acknowledgement
  1070. .b
  1071. .p
  1072. This research was primarily supported by 
  1073. National Science Foundation Grants BNS-82-14728 
  1074. and BNS-85-18675 to James Anderson, 
  1075. Department of Cognitive and Linguistic Sciences, Brown University,
  1076. Providence, RI, 02912.
  1077. Please acknowledge this grant if you make use of these
  1078. programs in published material.
  1079. .page
  1080. .c
  1081. References
  1082. .b2
  1083. .p
  1084. J.A. Anderson, Neural models for cognitive computation. 
  1085. ^&IEEE Transactions: Systems, Man, and
  1086. Cybernetics\&. 
  1087. 1983, ^&SMC-13\&,  799-815. (Reprinted in V. Vemuri (Ed.),
  1088. ^&Artificial Neural Networks: Theoretical Concepts\&, Washington, DC:
  1089. Computer Society Press of the IEEE, 1988.)
  1090. .p
  1091. J.A. Anderson, Cognitive Capabilities of a Parallel System.
  1092. In E. Bienenstock, F. Foglemann, and
  1093. G. Weisbuch. (Eds.)
  1094. ^&Disordered Systems and Biological
  1095. Organization\&, 
  1096. Berlin: Springer, 1986.
  1097. .p
  1098. J.A. Anderson and M. Mozer,
  1099. Categorization and selective neurons.
  1100. In: G. Hinton and J. Anderson (Eds.),
  1101. ^&Parallel Models for Associative Memory\&.
  1102. Hillsdale, New Jersey: Erlbaum Associates, 1981. Revised
  1103. Edition, 1988.
  1104. .p
  1105. J.A. Anderson and G.L. Murphy, Psychological Concepts in a Parallel System.
  1106. In J.D. Farmer, A. Lapedes, N. Packard, and B. Wendroff. (Eds.)
  1107. ^&Evolution, Games, and Learning.\&.
  1108. New York: North Holland, 1986. (With Gregory L. Murphy).
  1109. .p
  1110. J.A. Anderson, J. Silverstein, S. Ritz, and R. Jones,
  1111. Distinctive features, categorical perception and
  1112. probability learning: some applications of a neural
  1113. model.
  1114. ^&Psychological Review\&, 1978, &8&5, 597-603.
  1115. (Reprinted in J.A. Anderson and
  1116. E. Rosenfeld (Eds.), ^&Neurocomputing\&, Cambridge, MA: MIT Press,
  1117. 1988).
  1118. .page
  1119. .b2
  1120. .c
  1121. Appendix
  1122. .b
  1123. .c
  1124. Naming Conventions:
  1125. .p
  1126. 1) Pascal source programs are given the extension .PAS (of course)
  1127. and the executable files .EXE.
  1128. .p
  1129. 2) BSB.PAS uses a number of
  1130. INCLUDEd files written in Pascal, which are given the extension .INC.  
  1131. .p
  1132. 3) Files containing sets of stimulus vectors are given the 
  1133. extension .STM.  They are Pascal records containing a 60 character
  1134. header and a 200 dimensional floating point array.
  1135. .p
  1136. 4) Files containing matrices (actually files of a Pascal
  1137. RECORD type Neuron), are given the extension .NEU.  They
  1138. are Pascal records containing 200 `Neurons' which
  1139. contain some constants and an array of `Synapses'.
  1140. .p
  1141. 5) Files containing text are given the extension .RNO if
  1142. the text is in RUNOFF format and .MEM if it has formatted.
  1143. .p
  1144. 6) Command files are given the extension .COM.
  1145. .p
  1146. 7) Program output to a terminal is given the extension .OUT.
  1147.