예제 #1
0
    def afferent(self, src_properties, dest_properties):
        channel = dest_properties['SF'] if 'SF' in dest_properties else 1

        centerg = imagen.Gaussian(
            size=0.07385 * self.sf_spacing**(channel - 1),
            aspect_ratio=1.0,
            output_fns=[transferfn.DivisiveNormalizeL1()])
        surroundg = imagen.Gaussian(
            size=(4 * 0.07385) * self.sf_spacing**(channel - 1),
            aspect_ratio=1.0,
            output_fns=[transferfn.DivisiveNormalizeL1()])
        on_weights = imagen.Composite(generators=[centerg, surroundg],
                                      operator=numpy.subtract)
        off_weights = imagen.Composite(generators=[surroundg, centerg],
                                       operator=numpy.subtract)

        #TODO: strength=+strength_scale/len(cone_types) for 'On' center
        #TODO: strength=-strength_scale/len(cone_types) for 'Off' center
        #TODO: strength=-strength_scale/len(cone_types) for 'On' surround
        #TODO: strength=+strength_scale/len(cone_types) for 'Off' surround
        return Model.SharedWeightCFProjection.params(
            delay=0.05,
            strength=2.33 * self.strength_factor,
            name='Afferent',
            nominal_bounds_template=sheet.BoundingBox(
                radius=self.lgnaff_radius * self.sf_spacing**(channel - 1)),
            weights_generator=on_weights
            if dest_properties['polarity'] == 'On' else off_weights)
예제 #2
0
 def lateral_gain_control(self, src_properties, dest_properties):
     #TODO: Are those 0.25 the same as lgnlateral_radius/2.0?
     return Model.SharedWeightCFProjection.params(
         delay=0.05,
         dest_port=('Activity'),
         activity_group=(0.6, DivideWithConstant(c=0.11)),
         weights_generator=imagen.Gaussian(
             size=0.25,
             aspect_ratio=1.0,
             output_fns=[transferfn.DivisiveNormalizeL1()]),
         nominal_bounds_template=sheet.BoundingBox(radius=0.25),
         name=('LateralGC' + src_properties['eye']
               if 'eye' in src_properties else 'LateralGC'),
         strength=0.6 / len(self.attrs.Eyes))
예제 #3
0
    def afferent_surround(self, src_properties, dest_properties):
        surrounds=[]
        for color, color_code in self.ColorToChannel.items():
            if color in dest_properties['surround']:
                surrounds.append(color_code)

        return [Model.SharedWeightCFProjection.params(
            delay=0.05,
            strength=(4.7/2.33)*self.lgnaff_strength/len(surrounds)*(-1 if dest_properties['polarity'] == 'On' else 1),
            src_port='Activity%d'%surround,
            dest_port='Activity',
            weights_generator=imagen.Gaussian(size=0.07385*(4 if dest_properties['opponent'] is not 'Blue' else 1),
                                              aspect_ratio=1.0,
                                              output_fns=[transferfn.DivisiveNormalizeL1()]),
            name='AfferentSurround'+str(surround),
            nominal_bounds_template=sheet.BoundingBox(radius=self.lgnaff_radius))
            for surround in surrounds]
예제 #4
0
 def afferent_surround(self, src_properties, dest_properties):
     #TODO: strength=-strength_scale for 'On', +strength_scale for 'Off'
     #TODO: strength=-strength_scale/2 for dest_properties['opponent']=='Blue'
     #      dest_properties['surround']=='RedGreen' and dest_properties['polarity']=='On'
     #TODO: strength=+strength_scale/2 for above, but 'Off'
     #TODO: strength=-strength_scale/len(cone_types) for Luminosity 'On'
     #TODO: strength=+strength_scale/len(cone_types) for Luminosity 'Off'
     return Model.SharedWeightCFProjection.params(
         delay=0.05,
         strength=2.33 * self.strength_factor,
         weights_generator=imagen.Gaussian(
             size=4 * 0.07385,
             aspect_ratio=1.0,
             output_fns=[transferfn.DivisiveNormalizeL1()]),
         name='AfferentSurround' + src_properties['cone'],
         nominal_bounds_template=sheet.BoundingBox(
             radius=self.lgnaff_radius))
예제 #5
0
    def lateral_gain_control(self, src_properties, dest_properties):
        #TODO: Are those 0.25 the same as lgnlateral_radius/2.0?
        name='LateralGC'
        if 'eye' in src_properties:
            name+=src_properties['eye']
        if 'SF' in src_properties and self.gain_control_SF:
            name+=('SF'+str(src_properties['SF']))

        return Model.SharedWeightCFProjection.params(
            delay=0.05,
            dest_port=('Activity'),
            activity_group=(0.6,DivideWithConstant(c=0.11)),
            weights_generator=imagen.Gaussian(size=self.gain_control_size,
                                              aspect_ratio=1.0,
                                              output_fns=[transferfn.DivisiveNormalizeL1()]),
            nominal_bounds_template=sheet.BoundingBox(radius=self.gain_control_size),
            name=name,
            strength=0.6/(2 if self['binocular'] else 1))
예제 #6
0
 def afferent_center(self, src_properties, dest_properties):
     #TODO: It shouldn't be too hard to figure out how many retina sheets it connects to,
     #      then all the below special cases can be generalized!
     #TODO: strength=+strength_scale for 'On', strength=-strength_scale for 'Off'
     #TODO: strength=+strength_scale for dest_properties['opponent']=='Blue'
     #      dest_properties['surround']=='RedGreen' and dest_properties['polarity']=='On'
     #TODO: strength=-strength_scale for above, but 'Off'
     #TODO: strength=+strength_scale/len(cone_types) for Luminosity 'On'
     #TODO: strength=-strength_scale/len(cone_types) for Luminosity 'Off'
     return Model.SharedWeightCFProjection.params(
         delay=0.05,
         strength=2.33 * self.strength_factor,
         weights_generator=imagen.Gaussian(
             size=0.07385,
             aspect_ratio=1.0,
             output_fns=[transferfn.DivisiveNormalizeL1()]),
         name='AfferentCenter' + src_properties['cone'],
         nominal_bounds_template=sheet.BoundingBox(
             radius=self.lgnaff_radius))