



                A Walk Through the Rochester Connectionist Simulator


          _I_n_t_r_o_d_u_c_t_i_o_n

          These instructions are designed to  take  you  on  a  short  walk
          through  the  simulator.   Complete  instructions are given.  You
          will be introduced to some of the more  commonly  used  commands,
          but  by  no  means  all commands are exhibited.  This exercise is
          designed to enable you to use the simulator at a  minimal  level,
          upon which you can build.

          You will compile a C program file, make it into a simulator,  and
          run  your  simulator.  You will be introduced to various features
          of the simulator along the way, and will save and reload the net-
          work.   Read  this document through before commencing.  Note that
          all commands should be followed by hitting the RETURN  key.   All
          items  in  italics (or underlined, depending on your printer) are
          commands you should type.

          All the simulator files, and all files referred to here,  are  in
          the directory structure with root /u/connect.

          A network is built and simulated with the following steps:

               1) Write a C program with commands to  make  the  units  and
               links.
               2) Compile the C build file.
               3) Link the compiled object file with the simulator to  make
               an executable.
               4) Run the executable.
               5) Call the main network building function, written in  step
               1.
               6) Simulate using the simulator command interface.

          For this walk through step 1 has been done for you.  Consult  the
          manual  and  the  other  examples  for  ideas  as to how to write
          appropriate C code.  Steps 2 and 3 are handled with  the  makesim
          shell script.  Most of the instructions in this walk-through con-
          cern step 6.

          _W_a_l_k-_t_h_r_o_u_g_h

          First copy the C build file into your directory.  If you  already
          have  a  file  called network.c in your directory, rename it with
          the mv command (you can get details of the mv command  by  typing
          man mv).  To copy the C build file, us the cp command:

          _c_p   /_u/_c_o_n_n_e_c_t/_e_x_a_m_p_l_e/_w_a_l_k-_t_h_r_o_u_g_h/_n_e_t_w_o_r_k._c    _n_e_t_w_o_r_k._c

          You should now have a file network.c in  your  directory.   Check
          with  the  ls  command.  If it is not there, you have made a mis-
          take.  Try repeating the copy (cp) command.

          The next step is to make a simulator executable file.  Type:
9

9                                          1







                A Walk Through the Rochester Connectionist Simulator


          /_u/_c_o_n_n_e_c_t/_b_i_n/_m_a_k_e_s_i_m   -_n_g   _n_e_t_w_o_r_k._o   _s_i_m

          The -ng flag indicates no graphics.  It  is  easies  to  commence
          without the graphics interface.

          Now you should have a  simulator  executable  file  sim  in  your
          directory.  Run it by typing _s_i_m.  You should receive the simula-
          tor prompt:

                 Rochester Connectionist Simulator (4.0)

          integer version

          ->

          The first thing to do is check what  commands  are  availible  by
          typing  ?.   You  should  get  a screenful of information.  It is
          piped through the more command: when you see the word MORE,  just
          hit the space bar when you are ready for the next screenful.

          Next check out the help facility by typing _h_e_l_p.  This  will  get
          you the general help information.  Type _h_e_l_p _c_a_l_l to see what the
          _c_a_l_l command does.

          Now build the network.  The building function in the C  file  you
          copied is called, appropriately, build.  Call it from the simula-
          tor by typing _c_a_l_l _b_u_i_l_d.

          The network is now in place in the simulator.  We will spend some
          time  examining  it.   First  list the units with _l_i_s_t _u_n_i_t_s _a_l_l.
          Notice that the states are numbers.  This is  because  the  build
          function did not associate any names with state values.

          You will see that the network consists of  seven  units.   It  is
          basically  configured as a binary tree.  The four input units are
          two pairs which provide activation to the to hidden units,  which
          in  turn  activate  the output unit.  To see this link structure,
          type the command _l_i_s_t _l_i_n_k_s.  You will see a list of  which  unit
          receives input (activation) from which other units.

          Now we will examine unit 5 in more detail.  Type _d_i_s_p_l_a_y _u_n_i_t  _5.
          You  will  get a complete picture of the important aspects of the
          unit.

          Now let us try the various ways of specifying units.  In the pre-
          vious  command  you  specified  unit  5  by  giving its index, 5.
          Another way is to give the unit name.  Type _l_i_s_t _u_n_i_t _o_u_t_p_u_t.

          If you want to see all the units with the same name  (an  array),
          just  give  the name.  Type _l_i_s_t _u_n_i_t _i_n_p_u_t.  You should have all
          the four input units listed.

          You can also specify a range of units.  Suppose you wish to  list


                                          2







                A Walk Through the Rochester Connectionist Simulator


          the  1st  through  3rd  input  unit.   To do this, type _l_i_s_t _u_n_i_t
          _i_n_p_u_t[_0] - _i_n_p_u_t[_2].  You must use a space before and  after  the
          '-'.   You  should  have  units 0, 1 and 2 listed.  Note that the
          first input unit is specified as input[0].  Array indices  always
          start  at  0,  as  do  unit indices (the first unit has index 0).
          Another way to specify a range is with indices: type _l_i_s_t _u_n_i_t  _3
          -  _6.   You  should  have  units 3,4,5 and 6 listed.  One can mix
          modes: type _l_i_s_t _u_n_i_t _3 - _o_u_t_p_u_t.  You should have the same units
          listed again.

          Now we will make a set.  Type _a_d_d_s_e_t  _c_h_a_n_g_e  _i_n_p_u_t.   This  will
          create  a  set  called  change  containing the units named input.
          List the set by typing _l_i_s_t _u_n_i_t _c_h_a_n_g_e.  Now let us add the out-
          put  unit  to  the set.  Type _a_d_d_s_e_t _c_h_a_n_g_e _o_u_t_p_u_t.  List the set
          again with _l_i_s_t _u_n_i_t _c_h_a_n_g_e, and you will  see  that  the  output
          unit is listed along with the input units.

          Now let us remove units 4 through 6 from the  set.   To  do  this
          type  _r_e_m_s_e_t  _c_h_a_n_g_e  _4  -  _6.  List the set again with _l_i_s_t _u_n_i_t
          _c_h_a_n_g_e You should see the four input units listed.

          Suppose you wish to adjust the output value of the  input  units.
          Type  _o_u_t  _c_h_a_n_g_e _1.  This will change the output of the units in
          the set change to 1.  Since the set  change  contains  the  input
          units,  they  should  now  have output 1.  Confirm this by typing
          _l_i_s_t _u_n_i_t_s _c_h_a_n_g_e.  You can change the  potential  and  state  of
          units in a similar fashion, using the pot and state commands.

          Now  we  will  save  the  network   in   a   file.    Type   _s_a_v_e
          "_n_e_t_w_o_r_k._l_o_a_d".  The network will be in file network.load in your
          directory.  To confirm this, exit the simulator by  typing  _q_u_i_t.
          You  should be back in UNIX, with the usual UNIX prompt.  Type _l_s
          to list the files in  your  directory.   network.load  should  be
          amongst them.

          We will re-enter the simulator.  Type _s_i_m and you will once again
          get  the simulator prompt.  Note that now that we have re-entered
          the simulator, there is _n_o network set up.  We could repeat  what
          we  did  above  and  call the build function to build the network
          again.  But this time we shall load the network from the file  we
          saved  it  in.  Type _l_o_a_d "_n_e_t_w_o_r_k._l_o_a_d".  Now the network should
          be in exactly the same state as when  we  saved  it.   Type  _l_i_s_t
          _u_n_i_t_s _a_l_l to confirm that the input units have output 1.

          Up to now we have not done any simulation.   We  have  just  gone
          through  some of the more basic simulator commands.  To simulate,
          we use the go command.  Type _g_o _1.  The simulator will inform you
          that one step has been executed.

          Now let us examine the network.  Type  _l_i_s_t  _u_n_i_t_s  _a_l_l.   Notice
          that  the  input units no longer have output 1, but the output of
          the hidden units has changed.  Each hidden unit receives the out-
          put  of  two input units.  Type _d_i_s_p_l_a_y _u_n_i_t _h_i_d_d_e_n[_0] to examine


                                          3







                A Walk Through the Rochester Connectionist Simulator


          the first hidden unit in  more  detail.   Notice  that  the  site
          value, potential and output are now 2.

          Type _g_o _1, and examine the network again with _l_i_s_t _u_n_i_t _a_l_l.  Now
          you  will  see that only the output unit has any output.  Activa-
          tion flows from the input units through the hidden units  to  the
          output  unit.   Type _g_o _1 again, and then _l_i_s_t _u_n_i_t _a_l_l.  Now all
          units are inactive.

          Finally set the input units output value to 4 with _o_u_t _c_h_a_n_g_e  _4.
          Then use _g_o _2 to simulate 2 steps.  Type _l_i_s_t _u_n_i_t _a_l_l to confirm
          that all units are inactive except the output  unit  with  output
          16.

          Exit the simulator using _q_u_i_t.  This is  the  end  of  the  walk-
          through.   You  now know enough to compile and run your networks,
          once you have written the network building program in C.  Consult
          the  _U_s_e_r_s  _M_a_n_u_a_l  for  examples  and a description of how to do
          this.  The _A_d_v_a_n_c_e_d _P_r_o_g_r_a_m_m_i_n_g _M_a_n_u_a_l will introduce you to  all
          the  programming  aids  once  you  have  becom  familiar with the
          basics.  Good luck, and remember:

                    It's your connections that count!





























9

9                                          4



