Пример #1
0
def test_all_directions(x=0,y=0,scale=0.6):
   results=KeyedList()
##    g=pattern.Gaussian(x=x,y=y,aspect_ratio=4.66667,
##                        size=0.088388,scale=1.0)
   g = pattern.SineGrating(frequency=2.4,phase=0.0,orientation=0,scale=scale)
   inputs = {}
   for j in range(4):
      inputs['Retina%s'%j] = pattern.Sweeper(generator=copy.deepcopy(g),
                                              speed=2.0/24.0)

   for i in frange(0.0, 2.0, 2.0/18.0, inclusive=True): 

      orientation = i*pi+pi/2

      for j in range(4):
         s = inputs['Retina%s'%j] 
         s.step = j
         s.orientation = orientation
      
      pattern_present(inputs=inputs,duration=1.0,
                      plastic=False,
                      overwrite_previous=True,
                      apply_output_fn=True)

      if hasattr(topo,'guimain'):
         topo.guimain.refresh_activity_windows()

      results[i]=decode_feature(topo.sim['V1'],
                                preference_map="DirectionPreference")

   return results
Пример #2
0
def test_all_orientations(x=0,y=0):
   results=KeyedList()
   for i in frange(0.0, 1.0, 1.0/36.0, inclusive=True):
       input = pattern.Gaussian(x=x, y=y, orientation=i*pi,
                        size=0.088388, aspect_ratio=4.66667, scale=1.0)
       pattern_present(inputs={'Retina' : input}, duration=1.0,
                       plastic=False,
                       overwrite_previous=True,
                       apply_output_fn=True)
       if hasattr(topo,'guimain'):
           topo.guimain.refresh_activity_windows()
       results[i]=decode_feature(topo.sim['V1'], preference_map="OrientationPreference")
   return results
Пример #3
0
    def present_pattern(self):
        """
        Move the user created patterns into the GeneratorSheets, run for
        the specified length of time, then restore the original
        patterns.
        """
        topo.sim.run(0.0)  # ensure EPs are start()ed

        topo.sim.state_push()
        for f in self.pre_presentation_hooks: f()
        input_dict = dict([(sheet.name,sheet.input_generator) \
                           for sheet in self.plotgroup.sheets()])
        pattern_present(input_dict,self.duration,
                        plastic=self.plastic,overwrite_previous=False)
        topo.guimain.auto_refresh(update=False)
        for f in self.post_presentation_hooks: f()
        topo.sim.state_pop()