Exercise 1 - a Linear Gabor filter model


Objectives:

  1. Download the parameter files

  2. Examine the contents of the parameter files

    Open the model file and the stimulus file in a text editor to familiarize yourself with the parameters. (Alternatively, you can type "more GaborSimp.moo" to print the file to the screen, if you do not wish to use a text editor.)

  3. Run the model on the visual stimulus

    
      wm mod GaborSimp.moo sine_dir.stm t0.rsp tn 2048 stim_nrpt 3 outfile ex1
    
    
    This will print some diagnostic messages as the simulation runs, and will end by writing the saved spike responses in the file ex1.nd. To verify that the file exists, type "ls ex1.nd".

  4. View the response using the nData response browser (nd)

    Note, 'nd' is assumed to be a short name (alias) for calling the "nd.jar" executable - you might have to first create this alias.

    
      nd ex1.nd
    
    
    The nd browser should open and show you the raster plots of the spike trains generated by the model. Each horizontal line in the raster plot shows the response for one trial, and consists of a set of short vertical lines that indicate the time at which action potentials occurred.

    There is a shaded box (top center) that shows variable parmeters (the parameters of the stimulus that varied from trial to trial during the simulation. Go to the ComboBox for contrast and change it from all to 1, thereby excluding the trials having zero contrast.

    Next, compute the direction tuning curve by changing the Analysis from Raster to Tuning Curve.

    There is a ComboBox inset at the top of the main plotting window which says DC, you can switch this to highlight the other plot, F1. These represent the zero frequency component (DC) and amplitude of the fundamental Fourier component (F1), i.e., at the temporal frequency (TF) of the moving grating.

    You can see that this model neuron orientation tuned but is not direction selective, because it response about equally well to the grating stimulus moving at 0 and 180 degrees.

  5. Spatial frequency tuning

    In addition to orientation tuning, spatial frequency (SF) tuning is also a classical property of V1 neurons. Download this SF tuning stimulus,

    and run the model,
    
      wm mod GaborSimp.moo sine_sf.stm t0.rsp tn 2048 stim_nrpt 3 outfile ex1_sf
    
    
    and examine the output using the nData browser,
    
      nd ex1_sf.nd
    
    
    Examine the tuning curve (rember to select contrast as 1 to exclude the gray control trials), and note the preferred SF for this model.

    Classically, a cell is defined to be simple if the F1 response is greater than the DC response at the peak of SF tuning curve, and the ratio of F1/DC is used to quantify how simple a cell is (Note, the DC response needs to be measured in excess of the sponteneous rate). This ratio typically varies along the SF tuning curve, although that variation is not readily apparent here.

  6. Change a stimulus parameter and re-run the model

    You can change parameters in the model file and re-run the SF tuning curve (or the direction tuning curve) to see how the tuning of the simple cell changes with model parameters. Let's try this with the parameter that controls the SF of the spatial Gabor filter.

    The parameter is named sf and is within an "object" of type < filter > in the GaborSimp.moo file. The filter object has a parameter called "name" that allows us to refer to it as follows: filter.spatial/sf (general form: [object].[name]/[sub-object]). Thus, to run the model with a new value, say 4.0, of the sptial SF parameter (without actually editing the model file), use the following command:

    
      wm mod GaborSimp.moo sine_sf.stm t0.rsp tn 2048 stim_nrpt 3 filter.spatial/sf 4.0 outfile ex1_sf4
    
    
    Then, use the nData browser to examine the new SF tuning curve:
    
      nd ex1_sf4.nd
    
    
    You probably expected that the peak in the SF tuning curve would have shifted, but can you explain why the bandwidth (e.g., width at half height) is more narrow. (To be fair, the change in bandwidth should be appreciated on a log-x-axis, and unfortunately the nData browser does not yet allow you to change to a log axis).

    You can experiment with the model by changing the other parameters to become more familiar with the tuning of Gabor filters. You can also see pre-computed tuning curves for this model at www.iModel.org - click on the Models link on the left side of the main page, scroll down to Simple filter models, and click on GaborSimp.

  7. EXTRA: Further visualization

    When exploring the function of a model, it is important to visualize the elements of the model and the intermediate responses, not just the final output. Here are ways to do this with the GaborSimp model.

    • Visualize the 3D x,y,t filter.
        wm mod GaborSimp.moo sine_sf.stm t0.rsp tn 64 outfile foo model_write_filter 1
      
      When this finishes (you can ignore the foo.dn file), you can view the filter using the following command:
        norm3d zzz.filter.3d 8 &
      
      Then, click in the window that appears and hold down the 'k' key until something appears. Use the 'j' and 'k' keys to move forward and backward in time. (press 'h' to list some of the commands in the terminal window). Note, each frame is worth 2 ms (see 'tscale' in the model file) and each pixel is worth 0.04 deg (see 'sscale' in the model file).

      You can try re-running the 'wm' command above with the higher SF (see point 6.), and you will see that the spatial RF is quite different. You may appreciate that one must be careful not to violate the Nyquist limit when configuring the spatial filters.

    • Examine the raw response from the filter convolution, before spike generation.

      and run the model,
      
        wm mod GaborSimp.moo sine_sf.stm t0a.rsp tn 1024 stim_nrpt 1 outfile ex1_raw
      
      
      and view the response,
      
        nd ex1_raw.nd
      
      
      In the nData browser, change Channel to raw, and you will see the result of the filter operating on the drifting grating stimuli. These are the traces that are offset, scaled, rectified, and time-shifted (for causality) before being submitted to a Poisson spike generating mechanism.



    End of Exercise 1