topo.submodel Package


submodel Package

Inheritance diagram of topo.submodel

A set of tools which allow specifying a model consisting of sheets organized in levels, and projections connecting these sheets. The sheets have an attribute matchconditions allowing to specify which other (incoming) sheets a sheet should connect to.

Instances of the LabelDecorator decorator are offered for setting parameters/matchconditions for a sheet within a level, as well as parameters for projections.

class topo.submodel.ComponentDecorator(name, object_type)[source]

Bases: object

Decorator class that can be instantiated with a component type to create a decorator used to associate methods with the corresponding component.

This class works by setting a ‘_component_type’ attribute on the decorated method. Methods that have been annotated in this way may be tracked in classes decorated with the ComponentRegistry class decorator.

params(precedence=<type 'float'>, private=<type 'bool'>, seed=<type 'NoneType'>, apply_output_fns_init=<type 'bool'>, dest_port=<type 'str'>, strength=<type 'float'>, src_port=<type 'str'>, cf_type=<type 'type'>, cf_shape=<class 'imagen.patterngenerator.Constant'>, plastic=<type 'bool'>, delay=<type 'float'>, nominal_bounds_template=<class 'holoviews.core.boundingregion.BoundingBox'>, response_fn=<class 'topo.base.cf.CFPRF_Plugin'>, same_cf_shape_for_all_cfs=<type 'bool'>, activity_group=<type 'tuple'>, coord_mapper=<class 'topo.base.functionfamily.IdentityMF'>, mask_threshold=<type 'float'>, dest=<type 'NoneType'>, learning_rate=<type 'float'>, autosize_mask=<type 'bool'>, allow_null_cfs=<type 'bool'>, min_matrix_radius=<type 'int'>, learning_fn=<class 'topo.base.cf.CFPLF_Plugin'>, hash_format=<type 'str'>, src=<type 'NoneType'>, weights_generator=<class 'imagen.patterngenerator.Constant'>, name=<type 'str'>, weights_output_fns=<type 'list'>, input_fns=<type 'list'>, output_fns=<type 'list'>)[source]
class topo.submodel.ComponentRegistry[source]

Bases: object

An instance of this class is to be used as class decorator. Any decorated class using ClassDecorators on their methods will be registered with their corresponding component types.

compute_conditions(level, model, properties)[source]

Collect the matchcondition dictionary for a particular level given a certain Model instance and sheet properties. If no matchconditions are available, an empty dictionary is returned.

Respects the appropriate method resolution order (mro) of the given model instance.

lookup(cls, name, mode)[source]

Given a class, a method name and a mode, return either the component type (if mode=’type) or the appropriate method (if mode=’method’).

class topo.submodel.MatchConditions[source]

Bases: object

Decorator class for matchconditions.

class topo.submodel.Model(register=True, time_dependent=True, **params)[source]

Bases: param.parameterized.Parameterized

The available setup options are:

‘training_patterns’:
 fills the training_patterns AttrTree

with pattern generator instances. The path is the name of the input sheet. Usually calls PatternCoordinator to do this. :’sheets_setup’: determines the number of sheets, their types and names sets sheet parameters according to the registered methods in level sets sheet matchconditions according to the registered methods in matchconditions :’projections’: determines which connections should be present between the sheets according to the matchconditions of SheetSpec objects, using connect to specify the connection type and sets their parameters according to the registered methods in connect

The available instantiate options are:

‘sheets’:instantiates all sheets and registers them in

topo.sim :’projections’: instantiates all projections and registers them in topo.sim

param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
analysis_setup()[source]

Set up appropriate defaults for analysis functions in topo.analysis.featureresponses.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b0586208>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b0586260>
inspect_value = <functools.partial object at 0x2b07b05861b0>
items()[source]

The property items.

keys()[source]

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters[source]

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

property_setup(properties)[source]

Method to precompute any useful properties from the class parameters. For instance, if there is a num_lags parameter, this method could compute the actual projection delays and store it as properties[‘lags’]. The return value is the updated ‘properties’ dictionary.

In addition, this method can be used to configure class attributes of the model components.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b05862b8>
set_param = <functools.partial object at 0x2b07b05863c0>
setup(setup_options=True)[source]

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

sheet_setup()[source]

Returns a dictionary of properties or equivalent Lancet.Args object. Each outer key must be the level name and the values are lists of property dictionaries for the sheets at that level (or equivalent Lancet Args object). For instance, two LGN sheets at the ‘LGN’ level could be defined by either:

{‘LGN’:[{‘polarity’:’ON’}, {‘polarity’:’OFF’}]} OR {‘LGN’:lancet.List(‘polarity’, [‘ON’, ‘OFF’])}

The specified properties are used to initialize the sheets AttrTree with SheetSpec objects.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

training_pattern_setup(**overrides)[source]

Returns a dictionary of PatternGenerators to be added to self.training_patterns, with the target sheet name keys and pattern generator values.

The overrides keywords can be used by a subclass to parameterize the training patterns e.g. override the default parameters of a PatternCoordinator object.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

topo.submodel.order_projections(model, connection_order)[source]

Helper function for reproducing random streams when time_dependent=False (where the order of projection instantiation matters). This function should only be used for legacy reasons and should not be used with new models.

The first argument is an instance of Model (with projections configured) and the second is the projection ordering, specified by the (decorated) method names generating those projections.

This function allows sorting on a single source sheet property. To specify such an ordering, use a tuple where the first element is the relevant method name and the second element is a source sheet property dictionary to match. For instance, specifying the connection_order list as:

[(‘V1_afferent_projections’, {‘polarity’:’On’}), (‘V1_afferent_projections’, {‘polarity’:’Off’})]

will order the ‘On’ projections generated by the V1_afferent_projections method before the ‘Off’ projections.

topo.submodel.register_submodel_decorators(classes, superclass=None)[source]

Register a Model decorator for each of the non-abstract classes provided. Only registers those that are subclasses of the given superclass, if specified.

topo.submodel.select(index, *decorators)[source]

A meta-decorator that applies one-of-N possible decorators based on the index. The index may be a boolean value for selecting between two options.


color Module

Inheritance diagram of topo.submodel.color

Contains a model for the visual pathway with support for color including a version of the GCAL model with color support.

Please note that it will be able to remove most redundancies to the non-color EarlyVisionModel and ModelGCALColor as soon as a more modular system is implemented.

This file allows the results of fischer:ms14 to be replicated.

class topo.submodel.color.ColorEarlyVisionModel(register=True, time_dependent=True, **params)[source]

Bases: topo.submodel.earlyvision.EarlyVisionModel

An EarlyVisionModel extended with color support.

param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.375, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.27083, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Number area (allow_None=False, bounds=(0, None), constant=False, default=1.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. 2.0 gives a 2.0x2.0 Sheet area in V1.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.25, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Integer num_inputs (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param List cone_scale (allow_None=False, bounds=(0, None), constant=False, default=[0.9, 1.0, 0.97], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Scaling factors for the [L,M,S] cones. Default values are from De Paula (2007). Allows individual photoreceptor channels to be boosted or reduced relative to each other, e.g. to approximate the final result of a homeostatic process not being simulated.
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.07385, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.2954, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=2.33, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Boolean gain_control_color (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control in color sheets.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param ObjectSelector color_sim_type (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Trichromatic, instantiate=False, objects=[‘Dichromatic’, ‘Trichromatic’], pickle_default_value=True, precedence=None, readonly=False)
Whether the simulation should be dichromatic or trichromatic when ‘cr’ in dims.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Number color_strength (allow_None=False, bounds=(0.0, None), constant=False, default=0.75, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Ratio between strengths of LGN color vs. luminosity channel connections to V1. Examples:: :0.00: Monochrome simulation :0.50: Equal weight to color vs. luminosity channels :0.75: Equal weight to each channel (assuming 6 color and 2 lum channels) :1.00: No luminosity channels Note that luminosity channels are not required for developing monochromatic responses, so even for color_strength=1.0 there are normally orientation-selective and not color-selective neurons.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
analysis_setup()

Set up appropriate defaults for analysis functions in topo.analysis.featureresponses.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b090b418>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b090b4c8>
inspect_value = <functools.partial object at 0x2b07b090b520>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b090b9f0>
set_param = <functools.partial object at 0x2b07b090ba48>
setup(setup_options=True)

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.color.ModelGCALColor(register=True, time_dependent=True, **params)[source]

Bases: topo.submodel.color.ModelGCALInheritingColor

Implementing of ModelGCAL including color support.

As such, this class demonstrates the exact changes needed to the cortical sheet to support color, namely different strengths from the LGN to V1 depending on the type of LGN sheet (i.e. the luminosity sheet) as well as the addition of measurement code.

This class can be used to replicate the results in fischer:ms14

param Number latexc_radius (allow_None=False, bounds=(0, None), constant=False, default=0.104, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the radius of the lateral excitatory connections within V1.
param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.375, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.27083, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Boolean homeostasis (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not the homeostatic adaption should be applied in V1
param Number area (allow_None=False, bounds=(0, None), constant=False, default=1.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. 2.0 gives a 2.0x2.0 Sheet area in V1.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.25, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Number cortex_density (allow_None=False, bounds=(0, None), constant=False, default=47.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for V1.
param Integer num_inputs (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param List cone_scale (allow_None=False, bounds=(0, None), constant=False, default=[0.9, 1.0, 0.97], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Scaling factors for the [L,M,S] cones. Default values are from De Paula (2007). Allows individual photoreceptor channels to be boosted or reduced relative to each other, e.g. to approximate the final result of a homeostatic process not being simulated.
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.07385, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number aff_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the afferent projection(s) to V1.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number t_init (allow_None=False, bounds=None, constant=False, default=0.15, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The initial V1 threshold value. This value is static in the L and GCL models and adaptive in the AL and GCAL models.
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Number exc_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral excitatory projection to V1.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.2954, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param Number aff_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection to V1.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Number inh_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral inhibitory projection to V1.
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=2.33, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Boolean gain_control_color (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control in color sheets.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param ObjectSelector color_sim_type (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Trichromatic, instantiate=False, objects=[‘Dichromatic’, ‘Trichromatic’], pickle_default_value=True, precedence=None, readonly=False)
Whether the simulation should be dichromatic or trichromatic when ‘cr’ in dims.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Number exc_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral excitatory projection to V1.
param Number color_strength (allow_None=False, bounds=(0.0, None), constant=False, default=0.75, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Ratio between strengths of LGN color vs. luminosity channel connections to V1. Examples:: :0.00: Monochrome simulation :0.50: Equal weight to color vs. luminosity channels :0.75: Equal weight to each channel (assuming 6 color and 2 lum channels) :1.00: No luminosity channels Note that luminosity channels are not required for developing monochromatic responses, so even for color_strength=1.0 there are normally orientation-selective and not color-selective neurons.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number inh_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral inhibitory projection to V1.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number latinh_radius (allow_None=False, bounds=(0, None), constant=False, default=0.22917, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the radius of the lateral inhibitory connections within V1.
param Boolean expand_sf_test_range (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
By default, measure_sine_pref() measures SF at the sizes of RF used, for speed, but if expand_sf_test_range is True, it will test over a larger range, including half the size of the smallest and twice the size of the largest.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b090b310>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b090b260>
inspect_value = <functools.partial object at 0x2b07b090b418>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b090b470>
set_param = <functools.partial object at 0x2b07b090b3c0>
setup(setup_options=True)

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.color.ModelGCALInheritingColor(register=True, time_dependent=True, **params)[source]

Bases: topo.submodel.color.ColorEarlyVisionModel

This class file is identical to ModelGCAL (gcal.py) except for
inheritinf from ColorEarlyVisionModel instead of EarlyVisionModel. Color-specific changes are implemented in the ModelGCAL subclass of this file.
param Number latexc_radius (allow_None=False, bounds=(0, None), constant=False, default=0.104, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the radius of the lateral excitatory connections within V1.
param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.375, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.27083, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Boolean homeostasis (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not the homeostatic adaption should be applied in V1
param Number area (allow_None=False, bounds=(0, None), constant=False, default=1.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. 2.0 gives a 2.0x2.0 Sheet area in V1.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.25, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Number cortex_density (allow_None=False, bounds=(0, None), constant=False, default=47.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for V1.
param Integer num_inputs (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param List cone_scale (allow_None=False, bounds=(0, None), constant=False, default=[0.9, 1.0, 0.97], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Scaling factors for the [L,M,S] cones. Default values are from De Paula (2007). Allows individual photoreceptor channels to be boosted or reduced relative to each other, e.g. to approximate the final result of a homeostatic process not being simulated.
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.07385, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number aff_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the afferent projection(s) to V1.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number t_init (allow_None=False, bounds=None, constant=False, default=0.15, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The initial V1 threshold value. This value is static in the L and GCL models and adaptive in the AL and GCAL models.
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Number exc_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral excitatory projection to V1.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.2954, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param Number aff_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection to V1.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Number inh_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral inhibitory projection to V1.
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=2.33, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Boolean gain_control_color (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control in color sheets.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param ObjectSelector color_sim_type (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Trichromatic, instantiate=False, objects=[‘Dichromatic’, ‘Trichromatic’], pickle_default_value=True, precedence=None, readonly=False)
Whether the simulation should be dichromatic or trichromatic when ‘cr’ in dims.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Number exc_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral excitatory projection to V1.
param Number color_strength (allow_None=False, bounds=(0.0, None), constant=False, default=0.75, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Ratio between strengths of LGN color vs. luminosity channel connections to V1. Examples:: :0.00: Monochrome simulation :0.50: Equal weight to color vs. luminosity channels :0.75: Equal weight to each channel (assuming 6 color and 2 lum channels) :1.00: No luminosity channels Note that luminosity channels are not required for developing monochromatic responses, so even for color_strength=1.0 there are normally orientation-selective and not color-selective neurons.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number inh_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral inhibitory projection to V1.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number latinh_radius (allow_None=False, bounds=(0, None), constant=False, default=0.22917, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the radius of the lateral inhibitory connections within V1.
param Boolean expand_sf_test_range (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
By default, measure_sine_pref() measures SF at the sizes of RF used, for speed, but if expand_sf_test_range is True, it will test over a larger range, including half the size of the smallest and twice the size of the largest.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b090b0a8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b090b3c0>
inspect_value = <functools.partial object at 0x2b07b090b158>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b090b100>
set_param = <functools.partial object at 0x2b07b090b1b0>
setup(setup_options=True)

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.


earlyvision Module

Inheritance diagram of topo.submodel.earlyvision

Contains a variety of sensory models, specifically models for the visual pathway.


gcal Module

Inheritance diagram of topo.submodel.gcal

class topo.submodel.gcal.ExamplesGCAL(**params)[source]

Bases: topo.submodel.gcal.ModelGCAL

Reproduces the results of the legacy examples/gcal.ty file.

param Number latexc_radius (allow_None=False, bounds=(0, None), constant=False, default=0.104, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Radius of the lateral excitatory bounds within V1.
param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.375, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Number latexc_size (allow_None=False, bounds=(0, None), constant=False, default=0.05, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the lateral excitatory connections within V1.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.27083, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Boolean homeostasis (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not the homeostatic adaption should be applied in V1
param Number area (allow_None=False, bounds=(0, None), constant=False, default=1.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. 2.0 gives a 2.0x2.0 Sheet area in V1.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.25, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Number cortex_density (allow_None=False, bounds=(0, None), constant=False, default=47.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for V1.
param Integer num_inputs (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.07385, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number aff_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the afferent projection(s) to V1.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number target_activity (allow_None=False, bounds=None, constant=False, default=0.024, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The target average activity for the homeostatic threshold mechanism.
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Number exc_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral excitatory projection to V1.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.2954, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param Integer t_settle (allow_None=False, bounds=None, constant=False, default=16, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of settling steps before applying a reset in the V1 sheet.
param Number aff_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection to V1.
param Number latinh_size (allow_None=False, bounds=(0, None), constant=False, default=0.15, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the lateral inhibitory connections within V1.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Number inh_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral inhibitory projection to V1.
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=2.33, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Number t_init (allow_None=False, bounds=None, constant=False, default=0.15, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The initial V1 threshold value. This value is static in the L and GCL models and adaptive in the AL and GCAL models.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Number exc_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral excitatory projection to V1.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number inh_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral inhibitory projection to V1.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number latinh_radius (allow_None=False, bounds=(0, None), constant=False, default=0.22917, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Radius of the lateral inhibitory bounds within V1.
param Boolean expand_sf_test_range (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
By default, measure_sine_pref() measures SF at the sizes of RF used, for speed, but if expand_sf_test_range is True, it will test over a larger range, including half the size of the smallest and twice the size of the largest.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aef34e10>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aef34c58>
inspect_value = <functools.partial object at 0x2b07aef34b50>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07af1840a8>
set_param = <functools.partial object at 0x2b07af184100>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.


scal Module

Inheritance diagram of topo.submodel.scal

class topo.submodel.scal.EarlyVisionSCAL(register=True, time_dependent=True, **params)[source]

Bases: topo.submodel.earlyvision.EarlyVisionModel

EarlyVisionModel subclass with spatially calibrated extents used for SCAL and other models.

param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.27083, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Number area (allow_None=False, bounds=(0, None), constant=False, default=2.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. SCAL and other spatially calibrated variants of GCAL require cortical areas larger than 1.0x1.0 to avoid strong suppressive edge effects.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Boolean expand_sf_test_range (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
By default, measure_sine_pref() measures SF at the sizes of RF used, for speed, but if expand_sf_test_range is True, it will test over a larger range, including half the size of the smallest and twice the size of the largest.
param Number num_inputs (allow_None=False, bounds=(0, None), constant=False, default=1.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=14, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=16.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aff41998>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aff415d0>
inspect_value = <functools.partial object at 0x2b07aff41f18>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aff41418>
set_param = <functools.partial object at 0x2b07aff416d8>
setup(setup_options=True)

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

training_pattern_setup(**overrides)[source]

Only the size of Gaussian training patterns has been modified. The ‘aspect_ratio’ and ‘scale’ parameter values are unchanged.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.scal.ModelSCAL(register=True, time_dependent=True, **params)[source]

Bases: topo.submodel.scal.EarlyVisionSCAL, topo.submodel.gcal.ModelGCAL

Spatially-tuned GCAL (SCAL) calibrated to represent a 3 degree parafoveal region of macaque primary visual cortex, assuming a 3 mm/deg magnification factor and 0.71 mm orientation hypercolumn distance.

Changes from ModelGCAL include relative strengths, homeostatic sparsity constraints, connection radii and switching from subtractive to divisive inhibition. The explanation of the calibration process is explained in a forthcoming notebook.

param Number latexc_radius (allow_None=False, bounds=(0, None), constant=False, default=0.1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Radius of the lateral excitatory bounds within V1.
param Number lgnaff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to units in a retina sheet.
param Number period (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between pattern updates on the generator sheets. If None, the model is allowed to compute an appropriate value for the period property (a period of 1.0 is typical)
param ObjectSelector dataset (allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=Gaussian, instantiate=False, objects=[‘Gaussian’, ‘Nature’, ‘FoliageA’, ‘FoliageB’], pickle_default_value=True, precedence=None, readonly=False)
Set of input patterns to use:: :’Gaussian’: Two-dimensional Gaussians :’Nature’: Shouval’s 1999 monochrome 256x256 images :’FoliageA’: McGill calibrated LMS foliage/ image subset (5) :’FoliageB’: McGill calibrated LMS foliage/ image subset (25)
param Number max_disparity (allow_None=False, bounds=(0, None), constant=False, default=4.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Maximum disparity between input pattern positions in the left and right eye. Only used if ‘dy’ in ‘dims’.
param Number latexc_size (allow_None=False, bounds=(0, None), constant=False, default=0.06, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the lateral excitatory connections within V1.
param Integer num_lags (allow_None=False, bounds=(1, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of successive frames before showing a new input pattern. This also determines the number of connections between each individual LGN sheet and V1. Only used if ‘dr’ in ‘dims’.
param Number v1aff_radius (allow_None=False, bounds=(0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in V1 to units in a LGN sheet.
param Number speed (allow_None=False, bounds=(0, None), constant=False, default=0.0833333333333, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Distance in sheet coordinates between successive frames, when translating patterns. Only used if ‘dr’ in ‘dims’.
param Boolean homeostasis (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not the homeostatic adaption should be applied in V1
param Number area (allow_None=False, bounds=(0, None), constant=False, default=2.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Linear size of cortical area to simulate. SCAL and other spatially calibrated variants of GCAL require cortical areas larger than 1.0x1.0 to avoid strong suppressive edge effects.
param Number gain_control_size (allow_None=False, bounds=(0, None), constant=False, default=0.8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the divisive inhibitory suppressive field used for contrast-gain control in the LGN sheets. This also acts as the corresponding bounds radius.
param Number cortex_density (allow_None=False, bounds=(0, None), constant=False, default=47.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for V1.
param Number num_inputs (allow_None=False, bounds=(0, None), constant=False, default=1.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
How many input patterns to present per unit area at each iteration, when using discrete patterns (e.g. Gaussians).
param Number center_size (allow_None=False, bounds=(0, None), constant=False, default=0.2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the central Gaussian used to compute the center-surround receptive field.
param Number aff_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the afferent projection(s) to V1.
param Number retina_density (allow_None=False, bounds=(0, None), constant=False, default=24.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the retina.
param Integer sf_channels (allow_None=False, bounds=(1, None), constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of spatial frequency channels. Only used if ‘sf’ in ‘dims’.
param Number target_activity (allow_None=False, bounds=None, constant=False, default=0.024, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The target average activity for the homeostatic threshold mechanism.
param Boolean laterals (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Instantiate long-range lateral connections. Expensive!
param Number contrast (allow_None=False, bounds=(0, 100), constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Brightness of the input patterns as a contrast (percent). Only used if ‘od’ not in ‘dims’.
param Number exc_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral excitatory projection to V1.
param Integer random_seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overrides the default global seed on param.random_seed when not None.
param Number surround_size (allow_None=False, bounds=(0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The size of the surround Gaussian used to compute the center-surround receptive field.
param Integer t_settle (allow_None=False, bounds=None, constant=False, default=16, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of settling steps before applying a reset in the V1 sheet.
param Number aff_strength (allow_None=False, bounds=(0.0, None), constant=False, default=2.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection to V1.
param Number latinh_size (allow_None=False, bounds=(0, None), constant=False, default=0.115, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the lateral inhibitory connections within V1.
param List dims (allow_None=False, bounds=(0, None), constant=False, default=[‘xy’, ‘or’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Stimulus dimensions to include, out of the possible list: :’xy’: Position in x and y coordinates :’or’: Orientation :’od’: Ocular dominance :’dy’: Disparity :’dr’: Direction of motion :’sf’: Spatial frequency :’cr’: Color (if available, see submodels.color)
param Number inh_lr (allow_None=False, bounds=(0.0, None), constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Learning rate for the lateral inhibitory projection to V1.
param Number lateral_radius (allow_None=False, bounds=(0, None), constant=False, default=1.25, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Radius of the lateral excitatory bounds within V1Exc.
param Number latexc_lr (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Lateral excitatory connection learning rate.
param Number division_constant (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The constant offset on the denominator for divisive lateral inhibition to avoid divide-by-zero errors: divide(x,maximum(y,0) + division_constant).
param Boolean gain_control_SF (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control across Spatial Frequency Sheets.
param Number lgnaff_strength (allow_None=False, bounds=None, constant=False, default=14, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the afferent projection from the retina to the LGN sheets.
param Number latexc_strength (allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Lateral excitatory connection strength
param Number t_init (allow_None=False, bounds=None, constant=False, default=0.45, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The initial threshold value for homeostatic adaptation in V1.
param Number sf_spacing (allow_None=False, bounds=(1, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines the factor by which successive SF channels increase in size. Only used if ‘sf’ in ‘dims’.
param Boolean align_orientations (allow_None=True, bounds=(0, 1), constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to align pattern orientations together if composing multiple patterns together. If None, align_orientations will be set to True when speed is non-zero (and ‘dr’ in dims), otherwise it is set to False.
param Number exc_strength (allow_None=False, bounds=(0.0, None), constant=False, default=1.4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral excitatory projection to V1.
param Boolean gain_control (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to use divisive lateral inhibition in the LGN for contrast gain control.
param Number inh_strength (allow_None=False, bounds=(0.0, None), constant=False, default=2.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Overall strength of the lateral inhibitory projection to V1.
param Number lgn_density (allow_None=False, bounds=(0, None), constant=False, default=16.0, inclusive_bounds=(False, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The nominal_density to use for the LGN.
param Number latinh_radius (allow_None=False, bounds=(0, None), constant=False, default=0.18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Radius of the lateral inhibitory bounds within V1.
param Boolean expand_sf_test_range (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
By default, measure_sine_pref() measures SF at the sizes of RF used, for speed, but if expand_sf_test_range is True, it will test over a larger range, including half the size of the smallest and twice the size of the largest.
param Number dim_fraction (allow_None=False, bounds=(0.0, 1.0), constant=False, default=0.7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Fraction by which the input brightness varies between the two eyes. Only used if ‘od’ in ‘dims’.
param Number lgnlateral_radius (allow_None=False, bounds=(0, None), constant=False, default=0.8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Connection field radius of a unit in the LGN level to surrounding units, in case gain control is used.
param Number lateral_size (allow_None=False, bounds=(0, None), constant=False, default=2.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Size of the lateral excitatory connections within V1Exc.
debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aff41af8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aff41aa0>
inspect_value = <functools.partial object at 0x2b07aff41838>
items()

The property items.

keys()

The list of available property keys.

lateral_inhibitory(src_properties, dest_properties)[source]

Switch to divisive inhibition, otherwise parameters unchanged.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified model parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aff41db8>
set_param = <functools.partial object at 0x2b07aff41730>
setup(setup_options=True)

This method can be used to setup certain parts of the submodel. If setup_options=True, all setup methods are called. setup_options can also be a list, whereas all list items of available_setup_options are accepted.

Available setup options are: ‘training_patterns’,’sheets’,’projections’ and ‘analysis’.

This method returns a ModelSpec object which is also set as the value of the ‘specification’ attribute.

Please consult the docstring of the Model class for more information about each setup option.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

training_pattern_setup(**overrides)

Only the size of Gaussian training patterns has been modified. The ‘aspect_ratio’ and ‘scale’ parameter values are unchanged.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.


specifications Module

Inheritance diagram of topo.submodel.specifications

A set of objects that allows declarative specification of a model including training patterns, sheets and projections.

The components of a model specification can be individually inspected, modified, resolved or instantiated.

class topo.submodel.specifications.ArraySpec(pathspec, properties={})[source]

Bases: topo.submodel.specifications.Specification

A simple specification used to resolve numpy arrays relative to a Topographica simulation (i.e. topo.sim). This class is primarily aimed for specifying arrays to a Collector.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aea87578>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aea87788>
inspect_value = <functools.partial object at 0x2b07aea87050>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified specification parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aea87838>
set_param = <functools.partial object at 0x2b07aea872b8>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

update(**params)

Convenience method to easy update specification parameters.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.specifications.ModelSpec(model, properties)[source]

Bases: topo.submodel.specifications.Specification

ModelSpec acts as a template for Topographica model including training patterns, sheets and projections.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aea871b0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aea87418>
inspect_value = <functools.partial object at 0x2b07aea87ba8>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modifications(components=['model', 'sheets', 'projections'])[source]

Display the names of all modified parameters for the specified set of components.

By default all modified parameters are listed - first with the model parameters, then the sheet parameters and lastly the projection parameters.

modified_parameters

Dictionary of modified specification parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aea87578>
set_param = <functools.partial object at 0x2b07aea87e68>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

update(**params)

Convenience method to easy update specification parameters.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.specifications.ProjectionSpec(projection_type, src, dest)[source]

Bases: topo.submodel.specifications.Specification

ProjectionSpec acts as a template for projection objects.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aea87050>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aea875d0>
inspect_value = <functools.partial object at 0x2b07aea87838>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified specification parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aea872b8>
set_param = <functools.partial object at 0x2b07aea87c58>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

update(**params)

Convenience method to easy update specification parameters.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.specifications.SheetSpec(sheet_type, properties)[source]

Bases: topo.submodel.specifications.Specification

SheetSpec acts as a template for sheet objects.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aea87418>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aea87ba8>
inspect_value = <functools.partial object at 0x2b07aea87578>
items()

The property items.

keys()

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters

Dictionary of modified specification parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aea87e68>
set_param = <functools.partial object at 0x2b07aea87050>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

update(**params)

Convenience method to easy update specification parameters.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.submodel.specifications.Specification(object_type)[source]

Bases: param.parameterized.Parameterized

Specifications are templates for sheet or projection objects which may be resolved to the corresponding simulation object once instantiated.

All specifications have the following attribute:

‘parameters’:Keyword argument dictionary specifying which

parameters should be passed to the sheet or projection object.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aea87db8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aea87418>
inspect_value = <functools.partial object at 0x2b07aea872b8>
items()[source]

The property items.

keys()[source]

The list of available property keys.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

modified_parameters[source]

Dictionary of modified specification parameters

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

resolve()[source]

Returns the object in topo.sim corresponding to this object, typically a Sheet or a Projection.

The appropriate object must be available in topo.sim.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aea87838>
set_param = <functools.partial object at 0x2b07aea87a48>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

summary(printed=True)[source]

Generate a succinct summary of the Specification object. If printed is set to True, the summary is printed, otherwise it is returned as a string.

update(**params)[source]

Convenience method to easy update specification parameters.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.