#
#  MT_STF_1.moo
#

mod_type     me_v5      # Motion energy V5 model

sscale         0.1      # Spatial resolution of stimulus (degr/pix)
tscale         0.002    # Temporal resolution of stimulus (sec/frame)
xn            32        # Stimulus image width (pix)
yn            32        # Stimulus image height (pix)
tn           128        # Stimulus time duration (frames)

#--------------------------------------.--------------------------------------#
#                                                                             #
#                                      V1                                     #
#                                                                             #
#-----------------------------------------------------------------------------#
<v1>
  <filters>
    config      SFxTF               # Configuration of STF channels,
                                    # 'SFxTF' - matrix of SF and TF values.

    type        Gabor               # type of linear filter
    n_dir       12                  # Number of directions
    sf_list     1.0 2.0  (cyc/deg)  # SF values (one or more values)
    tf_list     8        (Hz)       # TF values (one or more values)
    #s_sd       0.18     (deg)      # SD space
    #t_sd       0.045    (s)        # SD time
    s_sd_f      0.22                # SD in space = this value times 1/SF
    t_sd_f      0.45                # SD in time = this value times 1/TF
    scale_sqrt  1.0                 # [1.0] normalization factor

    write_par_table  zz.filt.list   # Write a table of filter parameters
  </filters>

  <norm>
    type    local_stf   # Normalization type: 'rmsm', 'local_stf'
    alpha_1    0.99     # Tuned normalization
    alpha_2    0.01     # Untunded normalization
    alpha_3    0.014    # Small constant to avoid division by zero
  </norm>

  opponent_w      1.0      # [0.0] Weight of opponent signal (1.0 = full opp.)
  opponent_rect   1        # [0] 1-half-wave rectify after opponency; 0-do not
</v1>
#--------------------------------------.--------------------------------------#
#                                                                             #
#                                     AREA                                    #
#                                                                             #
#-----------------------------------------------------------------------------#
<area>
  name   mt          # Area name
  x0    14           # Origin w.r.t. stimulus grid
  y0    14           #
  xn     4           # width
  yn     4           # height
  umx   20.0 (um)    # microns per grid unit (stimulus grid)
</area>
#--------------------------------------.--------------------------------------#
#                                                                             #
#                                      MT                                     #
#                                                                             #
#-----------------------------------------------------------------------------#
<pop>
  name mt
  area mt

  <geometry>
    xn   4           # Layer width (units)
    yn   4           # Layer height (units)
    xf   1.0
    yf   1.0
  </geometry>

  <mt_stf>
    <weight_config>
      type          QOC_2016      # Weight configuration type
                                  #   QOC_2016 - Quaia, Optican, Cumming (2016)
      velocity_x    8.0  (deg/s)  # Preferred velocity, x-component
      velocity_y    0.0  (deg/s)  # Preferred velocity, y-component
      dist_sd_pref  1.0           # SD for Gaussian distance weight, preferred
      dist_sd_anti  1.0           # SD for Gaussian distance weight, opposite
      low_tf_sd     1.1  (cyc/s)  # SD for Gaussian suppression of low TFs
      low_tf_k      0.5           # Scale factor for excitatory low TF suppr.
      write_w_table zz.w.list     # Write a table of weights for STF channels
    </weight_config>

    <nonlin>
      type          half-rect     # Type of nonlinearity, "rmsm", "half-rect"
    </nonlin>
  </me_stf>

  <input>
    name        v1
    type        plain       # not a 'pop' type of input
    dir_config  stacked     # ['stacked'] or 'random'
    pop_origin  v1          # Population of origin of inputs

    <distrib>                 # Spatial distribution of V1 inputs
      type     distance       # Connection probability depends on distance
      cdist       0.6  (deg)  # (deg) crit connection distance (SD)
      shape    Gaussian       # Shape of distribution
      minw        0.05        # () suppress connections with lower weight
      seed     1777           # () Randomization seed for selecting inputs
      nsamp      60           # () number of inputs to select; 2-special geom.
      even_out    1           # 1-even out the distribution; 0-do not
    </distrib>
  </input>

  <spike_gen>
    type        poisson     # Spike gen. algorithm, dflt "poisson"; "ifc"
    offset0     0.0         # Add to filter output, BEFORE scaling (0.0)
    scale       0.004       # Multiply filter output (1.0)
    offset      0.001       # Add to filter output, AFTER scaling (0.0)
    toffset     0.060   (s) # Time delay added to spike times
    spike_dump  0           # Dump firing probability to 'zz.dump.pl' if 1
  </spike_gen>
</pop>