本文整理汇总了Python中context.Context.set_focus方法的典型用法代码示例。如果您正苦于以下问题:Python Context.set_focus方法的具体用法?Python Context.set_focus怎么用?Python Context.set_focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类context.Context
的用法示例。
在下文中一共展示了Context.set_focus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Grid
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import set_focus [as 别名]
# add stimulus sizes to root node...would be nicer if they went in stimulus node
s.add_rule('init',
'$kernel_length = 10',
'$output_length = 50',
'$bcm_radius = 4.',
'$stim_size = 20',
'$max_delay = 3')
# add all grids here? just name differently...
# NOTE: these are one longer than you think - fix?
# add a container for stimulus and 'focus' on it
s.add_node('$name = "stimulus"')
s.set_focus('$name == "stimulus"')
# add a distribution rule for stimulus points
s.add_rule('init',
# dx and dy were initially 2 for both of these, changing temporarily
'$stim_grid = Grid(xl=$stim_size, yl=$stim_size, dx=1, dy=1)',
# should just reset stim_grid instead of copying?
'$bph_grid = Grid(xl=$stim_size, yl=$stim_size, dx=1, dy=1)')
#'print $stim_grid.positions')
# also maintain a matrix of stimulus values for stimulus points to access
s.add_rule('init',
#'$stim = SinusoidStim($stim_size, $stim_size)', # why two?
#'$stim = JigglySinusoidStim($stim_size, 10)',
#'$stim = InvertingSinusoidStim($stim_size, 20)',
#'$stim = SquareWaveStim($stim_size, 8)',
示例2: JigglySinusoidStim
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import set_focus [as 别名]
#'$stim = JigglySinusoidStim($stim_size, 10)',
#'$stim = InvertingSinusoidStim($stim_size, 20)',
#'$stim = SquareWaveStim($stim_size, 8)',
#'$stim = BarStim($stim_size, 10)',
'$stim = FullFieldStim($stim_size, 20)',
'$stim.step()',
'$stim_data = $stim.output')
s.add_rule('update',
'$stim.step()',
'$stim_data = $stim.output')
# add photoreceptors (don't specify connections?)
s.add_node('$name = "p_layer"')
s.set_focus('$name == "p_layer"')
s.add_node('$name = "photoreceptor"')
s.set_focus('$name == "photoreceptor"')
# read from associated position in stimulus matrix
s.add_rule('init',
'$x, $y = $stim_grid.get_next()',
'$init_data($output_length)')
s.add_rule('interact',
'$temp_data = $stim_data[$x][$y]')
s.add_rule('update',
'$append_data($temp_data)',
'$clean_data($output_length)')
# ADD APPROPRIATE IRF!!