FittingΒΆ

Fitting is controlled by parameters in the <fit> object. The parameters are described below.

Turning fitting on / off:

fit  1  # Fit the model

This parameter takes the value 1 or 0 to indicate whether to run the fitting, or not, respectively.

Pre-computed responses:

file_c1_mode  write      # 'read', 'write', or 'none'
file_c1       foo.rr     # File name to be read or written

These parameters allow the responses of the C1 units to the stimulus set to be pre-computed. This saves considerable time if the fitting will be repeated for the same stimulus set. If “file_c1_mode” is set to “write”, then instead of actually doing the fitting, WM will simply compute the responses of all C1 units to all stimuli in the .stm file, and write these responses to the file name specfied by “file_c1”. In the example above, the file name is “foo.rr”. The output is a text file, but by convention we use the .rr file extension. WM will exit after writing the file.

To actually use the pre-computed response file for fitting, simply change the value of “file_c1_mode” to “read”, and re-run WM. Now, instead of having to compute all of the low-level responses, they will be read from the file specified by “file_c1”.

Specifying the target response file:

data_file   /Users/wyeth/w/data/pasu/pc2001/norm/a6701  # input file name

Provide a filename that contains the responses to be fit. The file contains a list of floating point values, the length of which must match the number of stimuli specified by the .stm file.

Testing the fit:

mode  default   # 'default', 'test_s2'

In the “default” mode, the fitting will be done. In the “test_s2” mode, rather than fitting, the S2 model, as specifed by the parameters in the <s2> object, will be tested by slightly varying the parameters and plotting the resulting MSE between the perturbed model and the target response data.

Output files for fitting results

The following parameters control the names of the output files that will contain results to quantify the fitting process:

outfile_best  *    # Best fit params (... .best.fit)
outfile_pp    *    # RF maps in postplot format (... .pp)
outfile_mse   *    # MSE vs. count of C1 inputs (... .pl)
outfile_boot  *    # Train, test MSE and r-val (... .boot.rval .boot.mse)
outfile_s2vtarg *  # Model v. target, scatter for each split (.s2vtarg.pl)
outfile_avgperf zz.avg  # Average performance over all splits ( )

Bootstrap

The following parameter object controls how the data are divided into training and test sets:

<bootstrap>
   split_n       3       # Number of splits
   split_frac    6       # For a 1/6 split, use 6
   split_type  random    # "random" - fully random splits each time
   split_seed   2343     # Randomization for shuffling train/test split
</bootstrap>

Stage 1 fitting

The first stage of fitting is to find the pair C1 units that gives the lowest MSE value. Stage 1 is controlled by the following parameter object:

<stage_1>
  <initial_values>
    s   1.0    # 0 - Sigmoid asymptote
    a   4.0    # 1 - Sigmoid slope
    b   1.0    # 2 - Sigmoid x-offset
    w0 -1.0    # 3 - Weight of first C1 input
    w1  1.0    # 4 - Weight of second C1 input

    <var_param>
      <var_range_n>
        1   0.5  5.0  2    # ParamIndex, ValInitial, ValFinal, NValues
      <>
     <var_range_n>
       2   0.4  1.6  2    # ParamIndex, ValInitial, ValFinal, NValues
     <>
     <var_range_n>
       3  -1.0  1.0  3   # Weight 0
     <>
     <var_range_n>
       4  -1.0  1.0  3   # Weight 1
     <>
    </var_param>
  </initial_values>
</stage_1>

Stage 2 fitting

The second stage of fitting consists of iteratively choosing the next best C1 input to add to the S2 model. The fitting is controlled by the parameter object:

<stage_2>

  max_c1_n   5 # 16    # Maximum number of C1 inputs to choose

  <initial_values>
    wn  1.0    # 5 - Weight of nth C1 input

    <var_param>
      <var_range_n>
        5  -2.0  3.0  10    # Weight n
      <>
    </var_param>
  </initial_values>
</stage_2>