featuremapper.featuremapper Package

featuremapper Package

Inheritance diagram of featuremapper.__init__

FeatureResponses and associated functions and classes.

These classes implement map and tuning curve measurement based on measuring responses while varying features of an input pattern.

class featuremapper.__init__.DistributionMatrix(matrix_shape, axis_range=(0.0, 1.0), cyclic=False, keep_peak=True)[source]

Bases: param.parameterized.Parameterized

params(name=String)

Maintains a matrix of Distributions (each of which is a dictionary of (feature value: activity) pairs).

The matrix contains one Distribution for each unit in a rectangular matrix (given by the matrix_shape constructor argument). The contents of each Distribution can be updated for a given bin value all at once by providing a matrix of new values to update().

The results can then be accessed as a matrix of weighted averages (which can be used as a preference map) and/or a selectivity map (which measures the peakedness of each distribution).

 Object has no parameters.

apply_DSF(dsf)[source]

Apply the given dsf DistributionStatisticFn on each element of the distribution_matrix

Return a dictionary of dictionaries, with the same structure of the called DistributionStatisticFn, but with matrices as values, instead of scalars

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 0x2ad5f3c83680>
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 0x2ad5f3c83998>
inspect_value = <functools.partial object at 0x2ad5f3c839f0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f3c83940>
set_param = <functools.partial object at 0x2ad5f3c83af8>
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(new_values, bin)[source]

Add a new matrix of histogram values for a given bin value.

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 featuremapper.__init__.FullMatrix(matrix_shape, features)[source]

Bases: param.parameterized.Parameterized

params(name=String)

Records the output of every unit in a sheet, for every combination of feature values. Useful for collecting data for later analysis while presenting many input patterns.

 Object has no parameters.

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 0x2ad5f3c83680>
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 0x2ad5f3c836d8>
inspect_value = <functools.partial object at 0x2ad5f3c837e0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f3c83730>
set_param = <functools.partial object at 0x2ad5f3c83788>
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(new_values, feature_value_permutation)[source]

Add a new matrix of histogram values for a given bin value.

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 featuremapper.__init__.FeatureResponses(**params)[source]

Bases: featuremapper.__init__.PatternDrivenAnalysis

params(cmd_overrides=Dict, durations=List, inputs=List, measurement_prefix=String, measurement_storage_hook=Callable, metadata_fns=HookList, metafeature_fns=HookList, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, repetitions=Integer, static_features=Dict, store_responses=Boolean, post_analysis_session_hooks=HookList, post_presentation_hooks=HookList, pre_analysis_session_hooks=HookList, pre_presentation_hooks=HookList, name=String)

Systematically vary input pattern feature values and collate the responses.

A DistributionMatrix for each measurement source and feature is created. The DistributionMatrix stores the distribution of activity values for that feature. For instance, if the features to be tested are orientation and phase, we will create a DistributionMatrix for orientation and a DistributionMatrix for phase for each measurement source. The orientation and phase of the input are then systematically varied (when measure_responses is called), and the responses of all units from a measurement source to each pattern are collected into the DistributionMatrix.

The resulting data can then be used to plot feature maps and tuning curves, or for similar types of feature-based analyses.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

cmd_overrides {} Dict V RW durations [1.0] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW measurement_storage_hook None Callable V RW AN metadata_fns [] HookList (0, None) V RW metafeature_fns [] HookList (0, None) V RW outputs [] List (0, None) V RW pattern_generator None Callable V RW AN pattern_response_fn None Callable V RW AN post_analysis_session_hooks [] HookList (0, None) V RW post_presentation_hooks [] HookList (0, None) V RW pre_analysis_session_hooks [] HookList (0, None) V RW pre_presentation_hooks [] HookList (0, None) V RW repetitions 1 Integer (1, None) V RW static_features {} Dict V RW store_responses False Boolean (0, 1) V RW

Parameter docstrings: =====================

cmd_overrides: Dictionary used to overwrite parameters on the pattern_response_fn. durations: Times after presentation,  when a measurement is taken. inputs: Names of the input supplied to  the metadata_fns to filter out desired inputs. measurement_prefix: Prefix to add to the name under which results are stored. measurement_storage_hook: Interface to store measurements after they have been completed. metadata_fns: Interface functions for metadata. Should return a dictionary that at a  minimum must contain the name and dimensions of the inputs and outputs  for pattern presentation and response measurement. metafeature_fns: Metafeature functions can be used to coordinate lower level features  across input devices or depending on a metafeature set on the function  itself. outputs: Names of the output source supplied to metadata_fns to filter out  desired outputs. pattern_generator: Defines the input pattern to be presented. pattern_response_fn: Presenter command responsible for presenting the input patterns provided  to it and returning the response for the requested measurement sources. post_analysis_session_hooks: List of callable objects to be run after an analysis session ends. post_presentation_hooks: List of callable objects to be run after each pattern is presented. pre_analysis_session_hooks: List of callable objects to be run before an analysis session begins. pre_presentation_hooks: List of callable objects to be run before each pattern is presented. repetitions: How many times each stimulus will be presented.    Each stimulus is specified by a particular feature combination, and  need only be presented once if the network has no other source of  variability. If results differ for each presentation of an identical  stimulus (e.g. due to intrinsic noise), then this parameter can be  increased so that results will be an average over the specified number  of repetitions. static_features: Dictionary containing name value pairs of a feature, which is to be  varied across measurements. store_responses: Determines whether or not to return the full set of responses to the  presented patterns.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presenter command responsible for presenting the input patterns provided to it and returning the response for the requested measurement sources.
param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Prefix to add to the name under which results are stored.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
param Boolean store_responses (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Determines whether or not to return the full set of responses to the presented patterns.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the output source supplied to metadata_fns to filter out desired outputs.
param List durations (allow_None=False, bounds=(0, None), constant=False, default=[1.0], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation, when a measurement is taken.
param Integer repetitions (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
How many times each stimulus will be presented. Each stimulus is specified by a particular feature combination, and need only be presented once if the network has no other source of variability. If results differ for each presentation of an identical stimulus (e.g. due to intrinsic noise), then this parameter can be increased so that results will be an average over the specified number of repetitions.
param Callable measurement_storage_hook (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Interface to store measurements after they have been completed.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the input supplied to the metadata_fns to filter out desired inputs.
param Dict cmd_overrides (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary used to overwrite parameters on the pattern_response_fn.
param Callable pattern_generator (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Defines the input pattern to be presented.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature functions can be used to coordinate lower level features across input devices or depending on a metafeature set on the function itself.
param HookList metadata_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Interface functions for metadata. Should return a dictionary that at a minimum must contain the name and dimensions of the inputs and outputs for pattern presentation and response measurement.
param Dict static_features (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary containing name value pairs of a feature, which is to be varied across measurements.
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 0x2ad5f3c83af8>
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 0x2ad5f3c83680>
inspect_value = <functools.partial object at 0x2ad5f3c83838>
instance = <functools.partial object at 0x2ad5f3c83b50>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_cmd_overrides = <functools.partial object at 0x2ad5f3c83940>[source]
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 0x2ad5f3c83c00>
set_param = <functools.partial object at 0x2ad5f3c83c58>
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 featuremapper.__init__.ReverseCorrelation(**params)[source]

Bases: featuremapper.__init__.FeatureResponses

params(continue_measurement=Boolean, roi=NumericTuple, cmd_overrides=Dict, durations=List, inputs=List, measurement_prefix=String, measurement_storage_hook=Callable, metadata_fns=HookList, metafeature_fns=HookList, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, repetitions=Integer, static_features=Dict, store_responses=Boolean, post_analysis_session_hooks=HookList, post_presentation_hooks=HookList, pre_analysis_session_hooks=HookList, pre_presentation_hooks=HookList, name=String)

Calculate the receptive fields for all neurons using reverse correlation.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

cmd_overrides {} Dict V RW continue_measurement True Boolean (0, 1) V RW durations [1.0] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW measurement_storage_hook None Callable V RW AN metadata_fns [] HookList (0, None) V RW metafeature_fns [] HookList (0, None) V RW outputs [] List (0, None) V RW pattern_generator None Callable V RW AN pattern_response_fn None Callable V RW AN post_analysis_session_hooks [] HookList (0, None) V RW post_presentation_hooks [] HookList (0, None) V RW pre_analysis_session_hooks [] HookList (0, None) V RW pre_presentation_hooks [] HookList (0, None) V RW repetitions 1 Integer (1, None) V RW roi (0, 0, 0, 0) NumericTuple V RW static_features {} Dict V RW store_responses False Boolean (0, 1) V RW

Parameter docstrings: =====================

cmd_overrides: Dictionary used to overwrite parameters on the pattern_response_fn. continue_measurement: < No docstring available > durations: Times after presentation,  when a measurement is taken. inputs: Names of the input supplied to  the metadata_fns to filter out desired inputs. measurement_prefix: Prefix to add to the name under which results are stored. measurement_storage_hook: Interface to store measurements after they have been completed. metadata_fns: Interface functions for metadata. Should return a dictionary that at a  minimum must contain the name and dimensions of the inputs and outputs  for pattern presentation and response measurement. metafeature_fns: Metafeature functions can be used to coordinate lower level features  across input devices or depending on a metafeature set on the function  itself. outputs: Names of the output source supplied to metadata_fns to filter out  desired outputs. pattern_generator: Defines the input pattern to be presented. pattern_response_fn: Presenter command responsible for presenting the input patterns provided  to it and returning the response for the requested measurement sources. post_analysis_session_hooks: List of callable objects to be run after an analysis session ends. post_presentation_hooks: List of callable objects to be run after each pattern is presented. pre_analysis_session_hooks: List of callable objects to be run before an analysis session begins. pre_presentation_hooks: List of callable objects to be run before each pattern is presented. repetitions: How many times each stimulus will be presented.    Each stimulus is specified by a particular feature combination, and  need only be presented once if the network has no other source of  variability. If results differ for each presentation of an identical  stimulus (e.g. due to intrinsic noise), then this parameter can be  increased so that results will be an average over the specified number  of repetitions. roi: If non-zero, specifies the subregion to perform reverse correlation  on. static_features: Dictionary containing name value pairs of a feature, which is to be  varied across measurements. store_responses: Determines whether or not to return the full set of responses to the  presented patterns.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presenter command responsible for presenting the input patterns provided to it and returning the response for the requested measurement sources.
param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Prefix to add to the name under which results are stored.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
param Boolean store_responses (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Determines whether or not to return the full set of responses to the presented patterns.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the output source supplied to metadata_fns to filter out desired outputs.
param List durations (allow_None=False, bounds=(0, None), constant=False, default=[1.0], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation, when a measurement is taken.
param Integer repetitions (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
How many times each stimulus will be presented. Each stimulus is specified by a particular feature combination, and need only be presented once if the network has no other source of variability. If results differ for each presentation of an identical stimulus (e.g. due to intrinsic noise), then this parameter can be increased so that results will be an average over the specified number of repetitions.
param NumericTuple roi (allow_None=False, constant=False, default=(0, 0, 0, 0), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False)
If non-zero, specifies the subregion to perform reverse correlation on.
param Callable measurement_storage_hook (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Interface to store measurements after they have been completed.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the input supplied to the metadata_fns to filter out desired inputs.
param Dict cmd_overrides (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary used to overwrite parameters on the pattern_response_fn.
param Callable pattern_generator (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Defines the input pattern to be presented.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature functions can be used to coordinate lower level features across input devices or depending on a metafeature set on the function itself.

param Boolean continue_measurement (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param HookList metadata_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Interface functions for metadata. Should return a dictionary that at a minimum must contain the name and dimensions of the inputs and outputs for pattern presentation and response measurement.
param Dict static_features (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary containing name value pairs of a feature, which is to be varied across measurements.
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 0x2ad5f3c837e0>
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 0x2ad5f3c83af8>
inspect_value = <functools.partial object at 0x2ad5f3c83730>
instance = <functools.partial object at 0x2ad5f3c83788>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_cmd_overrides = <functools.partial object at 0x2ad5f3c836d8>
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 0x2ad5f3c83aa0>
set_param = <functools.partial object at 0x2ad5f3c83cb0>
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 featuremapper.__init__.FeatureMaps(**params)[source]

Bases: featuremapper.__init__.FeatureResponses

params(preference_fn=ClassSelector, selectivity_multiplier=Number, cmd_overrides=Dict, durations=List, inputs=List, measurement_prefix=String, measurement_storage_hook=Callable, metadata_fns=HookList, metafeature_fns=HookList, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, repetitions=Integer, static_features=Dict, store_responses=Boolean, post_analysis_session_hooks=HookList, post_presentation_hooks=HookList, pre_analysis_session_hooks=HookList, pre_presentation_hooks=HookList, name=String)

Measure and collect the responses to a set of features, for calculating feature maps.

For each feature and each measurement source, the results are stored as a preference matrix and selectivity matrix in the sheet’s sheet_views; these can then be plotted as preference or selectivity maps.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

cmd_overrides {} Dict V RW durations [1.0] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW measurement_storage_hook None Callable V RW AN metadata_fns [] HookList (0, None) V RW metafeature_fns [] HookList (0, None) V RW outputs [] List (0, None) V RW pattern_generator None Callable V RW AN pattern_response_fn None Callable V RW AN post_analysis_session_hooks [] HookList (0, None) V RW post_presentation_hooks [] HookList (0, None) V RW pre_analysis_session_hooks [] HookList (0, None) V RW pre_presentation_hooks [] HookList (0, None) V RW preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW repetitions 1 Integer (1, None) V RW selectivity_multiplier 17.0 Number V RW static_features {} Dict V RW store_responses False Boolean (0, 1) V RW

Parameter docstrings: =====================

cmd_overrides: Dictionary used to overwrite parameters on the pattern_response_fn. durations: Times after presentation,  when a measurement is taken. inputs: Names of the input supplied to  the metadata_fns to filter out desired inputs. measurement_prefix: Prefix to add to the name under which results are stored. measurement_storage_hook: Interface to store measurements after they have been completed. metadata_fns: Interface functions for metadata. Should return a dictionary that at a  minimum must contain the name and dimensions of the inputs and outputs  for pattern presentation and response measurement. metafeature_fns: Metafeature functions can be used to coordinate lower level features  across input devices or depending on a metafeature set on the function  itself. outputs: Names of the output source supplied to metadata_fns to filter out  desired outputs. pattern_generator: Defines the input pattern to be presented. pattern_response_fn: Presenter command responsible for presenting the input patterns provided  to it and returning the response for the requested measurement sources. post_analysis_session_hooks: List of callable objects to be run after an analysis session ends. post_presentation_hooks: List of callable objects to be run after each pattern is presented. pre_analysis_session_hooks: List of callable objects to be run before an analysis session begins. pre_presentation_hooks: List of callable objects to be run before each pattern is presented. preference_fn: Function for computing a scalar-valued preference, selectivity,  etc. from the distribution of responses. Note that this default  is overridden by specific functions for individual features, if  specified in the Feature objects. repetitions: How many times each stimulus will be presented.    Each stimulus is specified by a particular feature combination, and  need only be presented once if the network has no other source of  variability. If results differ for each presentation of an identical  stimulus (e.g. due to intrinsic noise), then this parameter can be  increased so that results will be an average over the specified number  of repetitions. selectivity_multiplier: Scaling of the feature selectivity values, applied in all  feature dimensions. The multiplier sets the output scaling.  The precise value is arbitrary, and set to match historical  usage. static_features: Dictionary containing name value pairs of a feature, which is to be  varied across measurements. store_responses: Determines whether or not to return the full set of responses to the  presented patterns.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presenter command responsible for presenting the input patterns provided to it and returning the response for the requested measurement sources.
param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Prefix to add to the name under which results are stored.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
param Boolean store_responses (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Determines whether or not to return the full set of responses to the presented patterns.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the output source supplied to metadata_fns to filter out desired outputs.
param List durations (allow_None=False, bounds=(0, None), constant=False, default=[1.0], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation, when a measurement is taken.
param Integer repetitions (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
How many times each stimulus will be presented. Each stimulus is specified by a particular feature combination, and need only be presented once if the network has no other source of variability. If results differ for each presentation of an identical stimulus (e.g. due to intrinsic noise), then this parameter can be increased so that results will be an average over the specified number of repetitions.
param Callable measurement_storage_hook (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Interface to store measurements after they have been completed.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the input supplied to the metadata_fns to filter out desired inputs.
param Dict cmd_overrides (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary used to overwrite parameters on the pattern_response_fn.
param Callable pattern_generator (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Defines the input pattern to be presented.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature functions can be used to coordinate lower level features across input devices or depending on a metafeature set on the function itself.
param Number selectivity_multiplier (allow_None=False, bounds=None, constant=False, default=17.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Scaling of the feature selectivity values, applied in all feature dimensions. The multiplier sets the output scaling. The precise value is arbitrary, and set to match historical usage.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01091>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function for computing a scalar-valued preference, selectivity, etc. from the distribution of responses. Note that this default is overridden by specific functions for individual features, if specified in the Feature objects.
param HookList metadata_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Interface functions for metadata. Should return a dictionary that at a minimum must contain the name and dimensions of the inputs and outputs for pattern presentation and response measurement.
param Dict static_features (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary containing name value pairs of a feature, which is to be varied across measurements.
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 0x2ad5f3c83b50>
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 0x2ad5f3c837e0>
inspect_value = <functools.partial object at 0x2ad5f3c838e8>
instance = <functools.partial object at 0x2ad5f3c83838>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_cmd_overrides = <functools.partial object at 0x2ad5f3c83c58>
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 0x2ad5f3c83998>
set_param = <functools.partial object at 0x2ad5f3c83ba8>
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 featuremapper.__init__.FeatureCurves(**params)[source]

Bases: featuremapper.__init__.FeatureResponses

params(x_axis=String, cmd_overrides=Dict, durations=List, inputs=List, measurement_prefix=String, measurement_storage_hook=Callable, metadata_fns=HookList, metafeature_fns=HookList, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, repetitions=Integer, static_features=Dict, store_responses=Boolean, post_analysis_session_hooks=HookList, post_presentation_hooks=HookList, pre_analysis_session_hooks=HookList, pre_presentation_hooks=HookList, name=String)

Measures and collects the responses to a set of features, for calculating tuning and similar curves.

These curves represent the response of a measurement source to patterns that are controlled by a set of features. This class can collect data for multiple curves, each with the same x axis. The x axis represents the main feature value that is being varied, such as orientation. Other feature values can also be varied, such as contrast, which will result in multiple curves (one per unique combination of other feature values).

A particular set of patterns is constructed using a user-specified pattern_generator by adding the parameters determining the curve (curve_param_dict) to a static list of parameters (param_dict), and then varying the specified set of features. The input patterns will then be passed to the pattern_response_fn, which should return the measured responses for each of the requested sheets. Once the responses to all feature permutations has been accumulated, the measured curves are passed to the storage_fn and are finally returned.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

cmd_overrides {} Dict V RW durations [1.0] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW measurement_storage_hook None Callable V RW AN metadata_fns [] HookList (0, None) V RW metafeature_fns [] HookList (0, None) V RW outputs [] List (0, None) V RW pattern_generator None Callable V RW AN pattern_response_fn None Callable V RW AN post_analysis_session_hooks [] HookList (0, None) V RW post_presentation_hooks [] HookList (0, None) V RW pre_analysis_session_hooks [] HookList (0, None) V RW pre_presentation_hooks [] HookList (0, None) V RW repetitions 1 Integer (1, None) V RW static_features {} Dict V RW store_responses False Boolean (0, 1) V RW x_axis None String V RW

Parameter docstrings: =====================

cmd_overrides: Dictionary used to overwrite parameters on the pattern_response_fn. durations: Times after presentation,  when a measurement is taken. inputs: Names of the input supplied to  the metadata_fns to filter out desired inputs. measurement_prefix: Prefix to add to the name under which results are stored. measurement_storage_hook: Interface to store measurements after they have been completed. metadata_fns: Interface functions for metadata. Should return a dictionary that at a  minimum must contain the name and dimensions of the inputs and outputs  for pattern presentation and response measurement. metafeature_fns: Metafeature functions can be used to coordinate lower level features  across input devices or depending on a metafeature set on the function  itself. outputs: Names of the output source supplied to metadata_fns to filter out  desired outputs. pattern_generator: Defines the input pattern to be presented. pattern_response_fn: Presenter command responsible for presenting the input patterns provided  to it and returning the response for the requested measurement sources. post_analysis_session_hooks: List of callable objects to be run after an analysis session ends. post_presentation_hooks: List of callable objects to be run after each pattern is presented. pre_analysis_session_hooks: List of callable objects to be run before an analysis session begins. pre_presentation_hooks: List of callable objects to be run before each pattern is presented. repetitions: How many times each stimulus will be presented.    Each stimulus is specified by a particular feature combination, and  need only be presented once if the network has no other source of  variability. If results differ for each presentation of an identical  stimulus (e.g. due to intrinsic noise), then this parameter can be  increased so that results will be an average over the specified number  of repetitions. static_features: Dictionary containing name value pairs of a feature, which is to be  varied across measurements. store_responses: Determines whether or not to return the full set of responses to the  presented patterns. x_axis: Parameter to use for the x axis of tuning curves.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presenter command responsible for presenting the input patterns provided to it and returning the response for the requested measurement sources.
param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Prefix to add to the name under which results are stored.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
param Boolean store_responses (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Determines whether or not to return the full set of responses to the presented patterns.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the output source supplied to metadata_fns to filter out desired outputs.
param List durations (allow_None=False, bounds=(0, None), constant=False, default=[1.0], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation, when a measurement is taken.
param Integer repetitions (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
How many times each stimulus will be presented. Each stimulus is specified by a particular feature combination, and need only be presented once if the network has no other source of variability. If results differ for each presentation of an identical stimulus (e.g. due to intrinsic noise), then this parameter can be increased so that results will be an average over the specified number of repetitions.
param Callable measurement_storage_hook (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Interface to store measurements after they have been completed.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the input supplied to the metadata_fns to filter out desired inputs.
param Dict cmd_overrides (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary used to overwrite parameters on the pattern_response_fn.
param Callable pattern_generator (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Defines the input pattern to be presented.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature functions can be used to coordinate lower level features across input devices or depending on a metafeature set on the function itself.
param HookList metadata_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Interface functions for metadata. Should return a dictionary that at a minimum must contain the name and dimensions of the inputs and outputs for pattern presentation and response measurement.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Dict static_features (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary containing name value pairs of a feature, which is to be varied across measurements.
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 0x2ad5f3c83730>
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 0x2ad5f3c83b50>
inspect_value = <functools.partial object at 0x2ad5f3c83a48>
instance = <functools.partial object at 0x2ad5f3c836d8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_cmd_overrides = <functools.partial object at 0x2ad5f3c83cb0>
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 0x2ad5f3c83c00>
set_param = <functools.partial object at 0x2ad5f3c83680>
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 featuremapper.__init__.Feature(name, **params)

Bases: holoviews.core.dimension.Dimension

params(compute_fn=Callable, offset=Number, preference_fn=ClassSelector, steps=Integer, cyclic=Boolean, range=Tuple, soft_range=Tuple, type=Parameter, unit=String, value_format=Callable, values=ClassSelector, name=String)

Specifies several parameters required for generating a map of one input feature.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

compute_fn None Callable V RW AN cyclic False Boolean (0, 1) V RW offset 0.0 Number V RW preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW AN range (None, None) Tuple V RW soft_range (None, None) Tuple V RW steps 0 Integer V RW type None Parameter V RW AN unit None String V RW AN value_format None Callable V RW AN values [] ClassSelector V RW

Parameter docstrings: =====================

compute_fn: If non-None, a function that when given a list of other parameter  values, computes and returns the value for this feature. cyclic: Whether the range of this feature is cyclic such that the  maximum allowed value (defined by the range parameter) is  continuous with the minimum allowed value. offset: Offset to add to the values for this feature preference_fn: Function that will be used to analyze the distributions of unit response  to this feature. range: Specifies the minimum and maximum allowed values for a  Dimension. None is used to represent an unlimited bound. soft_range: Specifies a minimum and maximum reference value, which  may be overridden by the data. steps: Number of steps, between lower and upper range value, to be presented. type: Optional type associated with the Dimension values. The type  may be an inbuilt constructor (such as int, str, float) or a  custom class object. unit: Optional unit string associated with the Dimension. For  instance, the string ‘m’ may be used represent units of meters  and ‘s’ to represent units of seconds. value_format: Formatting function applied to each value before display. values: Optional set of allowed values for the dimension that can also  be used to retain a categorical ordering. Setting values to  ‘initial’ indicates that the values will be added during construction.

param ClassSelector preference_fn (allow_None=True, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01030>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit response to this feature.
param Boolean cyclic (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether the range of this feature is cyclic such that the maximum allowed value (defined by the range parameter) is continuous with the minimum allowed value.
param Callable compute_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
If non-None, a function that when given a list of other parameter values, computes and returns the value for this feature.
param Tuple soft_range (allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Specifies a minimum and maximum reference value, which may be overridden by the data.
param Tuple range (allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Specifies the minimum and maximum allowed values for a Dimension. None is used to represent an unlimited bound.
param ClassSelector values (allow_None=False, constant=False, default=[], instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Optional set of allowed values for the dimension that can also be used to retain a categorical ordering. Setting values to ‘initial’ indicates that the values will be added during construction.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Offset to add to the values for this feature
param Integer steps (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=False, time_fn=<Time Time00001>)
Number of steps, between lower and upper range value, to be presented.
param Parameter type (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional type associated with the Dimension values. The type may be an inbuilt constructor (such as int, str, float) or a custom class object.
param String unit (allow_None=True, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional unit string associated with the Dimension. For instance, the string ‘m’ may be used represent units of meters and ‘s’ to represent units of seconds.
param Callable value_format (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Formatting function applied to each value before display.
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 0x2ad5f3c837e0>
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 0x2ad5f3c83c00>
inspect_value = <functools.partial object at 0x2ad5f3c83730>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

pprint_label

The pretty-printed label string for the Dimension

pprint_value(value)

Applies the defined formatting to the value.

pprint_value_string(value)

Pretty prints the dimension name and value using the global title_format variable, including the unit string (if set). Numeric types are printed to the stated rounding level.

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 0x2ad5f3c838e8>
set_param = <functools.partial object at 0x2ad5f3c83c58>
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.

command Module

Inheritance diagram of featuremapper.command

User-level measurement commands, typically for measuring or generating SheetViews.

The file defines base classes for defining measurements and a large set of predefined measurement commands.

Some of the commands are ordinary Python functions, but the rest are ParameterizedFunctions, which act like Python functions but support Parameters with defaults, bounds, inheritance, etc. These commands are usually grouped together using inheritance so that they share a set of parameters and some code, and only the bits that are specific to that particular plot or analysis appear below. See the superclasses for the rest of the parameters and code.

class featuremapper.command.measure_corner_angle_pref(**params)[source]

Bases: featuremapper.command.PositionMeasurementCommand

params(angle_0=Number, angle_1=Number, num_angle=Integer, num_or=Integer, positions=Integer, divisions=Integer, size=Number, x_range=NumericTuple, y_range=NumericTuple, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Generate the preference map for angle shapes, by collating the response to patterns. Parameters of ‘measure_corner_angle_pref’ =========================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

angle_0 0.7853981633974483 Number (0.0, 3.14159265359) V RW angle_1 2.356194490192345 Number (0.0, 3.14159265359) V RW divisions 7 Integer (1, None) V RW durations [1.0] Parameter V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_angle 4 Integer (1, 12) V RW num_or 4 Integer (1, 24) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator GaussiansCorner(angle=1.5707963267948... Callable V RW pattern_response_fn None Callable V RW AN positions 7 Integer V RW preference_fn DSF_MaxValue(name=’DSF_MaxValue01117’... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 1.0 Number (0.0, 2.0) V RW size 0.2 Number (0, None) V RW static_parameters [‘size’, ‘scale’, ‘offset’] List (0, None) V RW subplot ‘’ String V RW x_range (-1.0, 1.0) NumericTuple V RW y_range (-1.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

angle_0: First angle to test. angle_1: Last angle to test. divisions: The number of different positions to measure in X and in Y. durations: Times after presentation  begins at which to record a measurement. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_angle: Number of angles to test. num_or: Number of orientations to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Callable object that will present a parameter-controlled  pattern to a set of Sheets. For measuring position, the  pattern_presenter should be spatially localized, yet also able  to activate the appropriate neurons reliably. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. positions: < No docstring available > preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_range: The range of X values to test. y_range: The range of Y values to test.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘size’, ‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param NumericTuple x_range (allow_None=False, constant=False, default=(-1.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of X values to test.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<GaussiansCorner GaussiansCorner01132>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. For measuring position, the pattern_presenter should be spatially localized, yet also able to activate the appropriate neurons reliably.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Integer num_angle (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=False, time_fn=<Time Time00001>)
Number of angles to test.
param Number 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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (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=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param Number angle_1 (allow_None=False, bounds=(0.0, 3.141592653589793), constant=False, default=2.35619449019, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Last angle to test.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_MaxValue DSF_MaxValue01117>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_or (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Number angle_0 (allow_None=False, bounds=(0.0, 3.141592653589793), constant=False, default=0.785398163397, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
First angle to test.
param NumericTuple y_range (allow_None=False, constant=False, default=(-1.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of Y values to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Integer divisions (allow_None=False, bounds=(1, None), constant=False, default=7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
The number of different positions to measure in X and in Y.

param Integer positions (allow_None=False, bounds=None, constant=False, default=7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)

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 0x2ad5f4536b50>
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 0x2ad5f4536d08>
inspect_value = <functools.partial object at 0x2ad5f4536cb0>
instance = <functools.partial object at 0x2ad5f4536e68>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f47bd208>
set_param = <functools.partial object at 0x2ad5f47bd260>
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 featuremapper.command.measure_corner_or_pref(**params)[source]

Bases: featuremapper.command.PositionMeasurementCommand

params(num_orientation=Integer, divisions=Integer, size=Number, x_range=NumericTuple, y_range=NumericTuple, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure a corner preference map by collating the response to patterns. Parameters of ‘measure_corner_or_pref’ ======================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

divisions 11 Integer (1, None) V RW durations [1.0] Parameter V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_orientation 4 Integer (1, 24) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator Composite(bounds=BoundingBox(radius=0... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_MaxValue(name=’DSF_MaxValue01117’... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 1.0 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘’ String V RW x_range (-1.2, 1.2) NumericTuple V RW y_range (-1.2, 1.2) NumericTuple V RW

Parameter docstrings: =====================

divisions: The number of different positions to measure in X and in Y. durations: Times after presentation  begins at which to record a measurement. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Callable object that will present a parameter-controlled  pattern to a set of Sheets. For measuring position, the  pattern_presenter should be spatially localized, yet also able  to activate the appropriate neurons reliably. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_range: The range of X values to test. y_range: The range of Y values to test.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_MaxValue DSF_MaxValue01117>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param NumericTuple x_range (allow_None=False, constant=False, default=(-1.2, 1.2), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of X values to test.
param Integer divisions (allow_None=False, bounds=(1, None), constant=False, default=11, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
The number of different positions to measure in X and in Y.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (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=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param NumericTuple y_range (allow_None=False, constant=False, default=(-1.2, 1.2), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of Y values to test.
param Callable pattern_generator (allow_None=False, constant=False, default=<Composite Composite01131>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. For measuring position, the pattern_presenter should be spatially localized, yet also able to activate the appropriate neurons reliably.
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 0x2ad5f4536fc8>
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 0x2ad5f4536f70>
inspect_value = <functools.partial object at 0x2ad5f4536db8>
instance = <functools.partial object at 0x2ad5f45369f0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f47cf260>
set_param = <functools.partial object at 0x2ad5f47cf2b8>
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 featuremapper.command.measure_dr_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(max_speed=Number, num_direction=Integer, num_speeds=Integer, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure a direction preference map by collating the response to patterns. Parameters of ‘measure_dr_pref’ ===============================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW max_speed 0.08333333333333333 Number (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_direction 6 Integer (1, 48) V RW num_orientation 4 Integer (1, 24) V RW num_phase 12 Integer (1, 48) V RW num_speeds 4 Integer (0, 10) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘Direction’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. max_speed: The maximum speed to measure (with zero always the minimum). measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_direction: Number of directions to test. num_orientation: Number of orientations to test. num_phase: Number of phases to test. num_speeds: Number of speeds to test (where zero means only static patterns). offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of  unit responses. Sets value_scale to normalize direction  preference values. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01128>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses. Sets value_scale to normalize direction preference values.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_direction (allow_None=False, bounds=(1, None), constant=False, default=6, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of directions to test.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number max_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=False, time_fn=<Time Time00001>)
The maximum speed to measure (with zero always the minimum).
param Integer num_speeds (allow_None=False, bounds=(0, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of speeds to test (where zero means only static patterns).
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>, <class ‘featuremapper.metaparams.direction2translation’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Direction, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f45369f0>
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 0x2ad5f4536838>
inspect_value = <functools.partial object at 0x2ad5f4536ba8>
instance = <functools.partial object at 0x2ad5f4536b50>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f47e12b8>
set_param = <functools.partial object at 0x2ad5f47e1310>
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 featuremapper.command.measure_hue_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(num_hue=Integer, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure a hue preference map by collating the response to patterns. Parameters of ‘measure_hue_pref’ ================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_hue 8 Integer (1, 48) V RW num_orientation 4 Integer (1, 24) V RW num_phase 12 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [] List (0, None) V RW subplot ‘Hue’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_hue: Number of hues to test. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Integer num_hue (allow_None=False, bounds=(1, None), constant=False, default=8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of hues to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>, <class ‘featuremapper.metaparams.hue2rgbscale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Hue, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f4536cb0>
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 0x2ad5f4536af8>
inspect_value = <functools.partial object at 0x2ad5f4536f70>
instance = <functools.partial object at 0x2ad5f4536fc8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f47f1310>
set_param = <functools.partial object at 0x2ad5f47f1368>
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 featuremapper.command.measure_od_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measure an ocular dominance preference map by collating the response to patterns.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_orientation 4 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>, <class ‘featuremapper.metaparams.ocular2leftrightscale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f4536fc8>
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 0x2ad5f4536aa0>
inspect_value = <functools.partial object at 0x2ad5f4536c00>
instance = <functools.partial object at 0x2ad5f4536838>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f4806368>
set_param = <functools.partial object at 0x2ad5f48063c0>
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 featuremapper.command.measure_or_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure an orientation preference map by collating the response to patterns. Parameters of ‘measure_or_pref’ ===============================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_orientation 4 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘Orientation’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01127>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Orientation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f4536838>
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 0x2ad5f4536d08>
inspect_value = <functools.partial object at 0x2ad5f4536cb0>
instance = <functools.partial object at 0x2ad5f4816050>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48163c0>
set_param = <functools.partial object at 0x2ad5f4816418>
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 featuremapper.command.measure_phasedisparity(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(num_disparity=Integer, orientation=Number, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measure a phase disparity preference map by collating the response to patterns.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_disparity 12 Integer (1, 48) V RW num_orientation 4 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW orientation 1.5707963267948966 Number (0.0, 6.28318530718) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘orientation’, ‘scale’, ‘offset’] List (0, None) V RW subplot ‘’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_disparity: Number of disparity values to test. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. orientation: Orientation of the test pattern; typically vertical to measure  horizontal disparity. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘orientation’, ‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Number orientation (allow_None=False, bounds=None, constant=False, default=1.57079632679, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Orientation of the test pattern; typically vertical to measure horizontal disparity.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>, <class ‘featuremapper.metaparams.phasedisparity2leftrightphase’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Integer num_disparity (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of disparity values to test.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f45369f0>
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 0x2ad5f4536fc8>
inspect_value = <functools.partial object at 0x2ad5f4536a48>
instance = <functools.partial object at 0x2ad5f4826050>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f4826418>
set_param = <functools.partial object at 0x2ad5f4826470>
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 featuremapper.command.measure_response(**params)[source]

Bases: featuremapper.FeatureResponses

params(input_patterns=Dict, cmd_overrides=Dict, durations=List, inputs=List, measurement_prefix=String, measurement_storage_hook=Callable, metadata_fns=HookList, metafeature_fns=HookList, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, repetitions=Integer, static_features=Dict, store_responses=Boolean, post_analysis_session_hooks=HookList, post_presentation_hooks=HookList, pre_analysis_session_hooks=HookList, pre_presentation_hooks=HookList, name=String) Parameters of ‘measure_response’ ================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

cmd_overrides {} Dict V RW durations [1.0] List (0, None) V RW input_patterns {} Dict V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW measurement_storage_hook None Callable V RW AN metadata_fns [] HookList (0, None) V RW metafeature_fns [] HookList (0, None) V RW outputs [] List (0, None) V RW pattern_generator Gaussian(aspect_ratio=3.2258064516129... Callable V RW pattern_response_fn None Callable V RW AN post_analysis_session_hooks [] HookList (0, None) V RW post_presentation_hooks [] HookList (0, None) V RW pre_analysis_session_hooks [] HookList (0, None) V RW pre_presentation_hooks [] HookList (0, None) V RW repetitions 1 Integer (1, None) V RW static_features {} Dict V RW store_responses False Boolean (0, 1) V RW

Parameter docstrings: =====================

cmd_overrides: Dictionary used to overwrite parameters on the pattern_response_fn. durations: Times after presentation,  when a measurement is taken. input_patterns: Assigns patterns to different inputs overriding the  pattern_generator parameter. If all inputs have not been  assigned a pattern, remaining inputs will be presented a  blank pattern. inputs: Names of the input supplied to  the metadata_fns to filter out desired inputs. measurement_prefix: Prefix to add to the name under which results are stored. measurement_storage_hook: Interface to store measurements after they have been completed. metadata_fns: Interface functions for metadata. Should return a dictionary that at a  minimum must contain the name and dimensions of the inputs and outputs  for pattern presentation and response measurement. metafeature_fns: Metafeature functions can be used to coordinate lower level features  across input devices or depending on a metafeature set on the function  itself. outputs: Names of the output source supplied to metadata_fns to filter out  desired outputs. pattern_generator: Callable object that will generate input patterns coordinated  using a list of meta parameters. pattern_response_fn: Presenter command responsible for presenting the input patterns provided  to it and returning the response for the requested measurement sources. post_analysis_session_hooks: List of callable objects to be run after an analysis session ends. post_presentation_hooks: List of callable objects to be run after each pattern is presented. pre_analysis_session_hooks: List of callable objects to be run before an analysis session begins. pre_presentation_hooks: List of callable objects to be run before each pattern is presented. repetitions: How many times each stimulus will be presented.    Each stimulus is specified by a particular feature combination, and  need only be presented once if the network has no other source of  variability. If results differ for each presentation of an identical  stimulus (e.g. due to intrinsic noise), then this parameter can be  increased so that results will be an average over the specified number  of repetitions. static_features: Dictionary containing name value pairs of a feature, which is to be  varied across measurements. store_responses: Determines whether or not to return the full set of responses to the  presented patterns.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presenter command responsible for presenting the input patterns provided to it and returning the response for the requested measurement sources.
param HookList pre_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before each pattern is presented.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Prefix to add to the name under which results are stored.
param HookList post_presentation_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after each pattern is presented.
param HookList post_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run after an analysis session ends.
param HookList pre_analysis_session_hooks (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callable objects to be run before an analysis session begins.
param Boolean store_responses (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Determines whether or not to return the full set of responses to the presented patterns.
param Dict input_patterns (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Assigns patterns to different inputs overriding the pattern_generator parameter. If all inputs have not been assigned a pattern, remaining inputs will be presented a blank pattern.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the output source supplied to metadata_fns to filter out desired outputs.
param List durations (allow_None=False, bounds=(0, None), constant=False, default=[1.0], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation, when a measurement is taken.
param Integer repetitions (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
How many times each stimulus will be presented. Each stimulus is specified by a particular feature combination, and need only be presented once if the network has no other source of variability. If results differ for each presentation of an identical stimulus (e.g. due to intrinsic noise), then this parameter can be increased so that results will be an average over the specified number of repetitions.
param Callable measurement_storage_hook (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Interface to store measurements after they have been completed.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Names of the input supplied to the metadata_fns to filter out desired inputs.
param Dict cmd_overrides (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary used to overwrite parameters on the pattern_response_fn.
param Callable pattern_generator (allow_None=False, constant=False, default=<Gaussian Gaussian01125>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will generate input patterns coordinated using a list of meta parameters.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature functions can be used to coordinate lower level features across input devices or depending on a metafeature set on the function itself.
param HookList metadata_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Interface functions for metadata. Should return a dictionary that at a minimum must contain the name and dimensions of the inputs and outputs for pattern presentation and response measurement.
param Dict static_features (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Dictionary containing name value pairs of a feature, which is to be varied across measurements.
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 0x2ad5f4536db8>
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 0x2ad5f4536cb0>
inspect_value = <functools.partial object at 0x2ad5f483e0a8>
instance = <functools.partial object at 0x2ad5f483e100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_cmd_overrides = <functools.partial object at 0x2ad5f483e470>
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 0x2ad5f483e578>
set_param = <functools.partial object at 0x2ad5f483e5d0>
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 featuremapper.command.measure_rfs(**params)[source]

Bases: featuremapper.command.SingleInputResponseCommand

params(presentations=Number, roi=NumericTuple, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Map receptive fields by reverse correlation.

Presents a large collection of input patterns, typically white noise, keeping track of which units in the specified input_sheet were active when each unit in other Sheets in the simulation was active. This data can then be used to plot receptive fields for each unit. Note that the results are true receptive fields, not the connection fields usually presented in lieu of receptive fields, because they take all circuitry in between the input and the target unit into account.

Note also that it is crucial to set the scale parameter properly when using units with a hard activation threshold (as opposed to a smooth sigmoid), because the input pattern used here may not be a very effective way to drive the unit to activate. The value should be set high enough that the target units activate at least some of the time there is a pattern on the input.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW offset 0.5 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator UniformRandom(bounds=BoundingBox(radi... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_MaxValue(name=’DSF_MaxValue01117’... ClassSelector V RW preference_lookup_fn None Callable V RW AN presentations 100 Number V RW roi (0, 0, 0, 0) NumericTuple V RW scale 30.0 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Presented pattern for reverse correlation, usually white noise. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. presentations: Number of presentations to run the reverse correlation for. roi: If non-zero ROI bounds is specified only the RFs in that  subregion are recorded. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_MaxValue DSF_MaxValue01117>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param NumericTuple roi (allow_None=False, constant=False, default=(0, 0, 0, 0), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False)
If non-zero ROI bounds is specified only the RFs in that subregion are recorded.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Number presentations (allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of presentations to run the reverse correlation for.
param Number scale (allow_None=False, bounds=None, constant=False, default=30.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<UniformRandom UniformNoise>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Presented pattern for reverse correlation, usually white noise.
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 0x2ad5f4536d08>
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 0x2ad5f4536f18>
inspect_value = <functools.partial object at 0x2ad5f4853050>
instance = <functools.partial object at 0x2ad5f4853100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48534c8>
set_param = <functools.partial object at 0x2ad5f4853520>
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 featuremapper.command.measure_second_or_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(true_peak=Boolean, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure the secondary orientation preference maps. Parameters of ‘measure_second_or_pref’ ======================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_orientation 16 Integer (1, 64) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘Second Orientation’ String V RW true_peak True Boolean (0, 1) V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. true_peak: If set the second  orientation response is computed on the true second mode of the  orientation distribution, otherwise is just the second maximum  response

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=16, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Boolean true_peak (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
If set the second orientation response is computed on the true second mode of the orientation distribution, otherwise is just the second maximum response
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Second Orientation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f4536f18>
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 0x2ad5f4863050>
inspect_value = <functools.partial object at 0x2ad5f48630a8>
instance = <functools.partial object at 0x2ad5f4863158>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f4863520>
set_param = <functools.partial object at 0x2ad5f4863578>
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 featuremapper.command.measure_sine_pref(**params)[source]

Bases: featuremapper.command.SinusoidalMeasureResponseCommand

params(max_speed=Number, num_direction=Integer, num_disparity=Integer, num_hue=Integer, num_ocularity=Integer, num_speeds=Integer, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measure preferences for sine gratings in various combinations. Can measure orientation, spatial frequency, spatial phase, ocular dominance, horizontal phase disparity, color hue, motion direction, and speed of motion.

In practice, this command is useful for any subset of the possible combinations, but if all combinations are included, the number of input patterns quickly grows quite large, much larger than the typical number of patterns required for an entire simulation. Thus typically this command will be used for the subset of dimensions that need to be evaluated together, while simpler special-purpose routines are provided below for other dimensions (such as hue and disparity).

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW max_speed 0.08333333333333333 Number (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_direction 0 Integer (0, 48) V RW num_disparity 1 Integer (1, 48) V RW num_hue 1 Integer (1, 48) V RW num_ocularity 1 Integer (1, 3) V RW num_orientation 4 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW num_speeds 4 Integer (0, 10) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [‘scale’, ‘offset’] List (0, None) V RW subplot ‘Orientation’ String V RW

Parameter docstrings: =====================

durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. max_speed: The maximum speed to measure (with zero always the minimum). measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_direction: Number of directions to test. If nonzero, overrides num_orientation,  because the orientation is calculated to be perpendicular to the direction. num_disparity: Number of disparity values to test; set to 1 to disable or e.g. 12 to enable. num_hue: Number of hues to test; set to 1 to disable or e.g. 8 to enable. num_ocularity: Number of ocularity values to test; set to 1 to disable or 2 to enable. num_orientation: Number of orientations to test. num_phase: Number of phases to test. num_speeds: Number of speeds to test (where zero means only static patterns).  Ignored when num_direction=0. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param Integer num_hue (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of hues to test; set to 1 to disable or e.g. 8 to enable.
param Integer num_direction (allow_None=False, bounds=(0, None), constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of directions to test. If nonzero, overrides num_orientation, because the orientation is calculated to be perpendicular to the direction.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01118>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>, <class ‘featuremapper.metaparams.direction2translation’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Integer num_orientation (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=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Integer num_speeds (allow_None=False, bounds=(0, None), constant=False, default=4, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of speeds to test (where zero means only static patterns). Ignored when num_direction=0.
param Integer num_ocularity (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of ocularity values to test; set to 1 to disable or 2 to enable.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Number max_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=False, time_fn=<Time Time00001>)
The maximum speed to measure (with zero always the minimum).
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param Integer num_disparity (allow_None=False, bounds=(1, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of disparity values to test; set to 1 to disable or e.g. 12 to enable.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=Orientation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
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 0x2ad5f4536998>
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 0x2ad5f487c0a8>
inspect_value = <functools.partial object at 0x2ad5f487c100>
instance = <functools.partial object at 0x2ad5f487c1b0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f487c578>
set_param = <functools.partial object at 0x2ad5f487c5d0>
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 featuremapper.command.measure_contrast_response(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(relative_orientations=List, coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measures contrast response curves for a particular unit.

Uses a circular sine grating stimulus at the preferred orientation and retinal position of the specified unit. Orientation and position preference must be calulated before measuring contrast response.

The curve can be plotted at various different values of the contrast (or actually any other parameter) of the stimulus. If using contrast and the network contains an LGN layer, then one would usually specify weber_contrast as the contrast_parameter. If there is no explicit LGN, then scale (offset=0.0) can be used to define the contrast. Other relevant contrast definitions (or other parameters) can also be used, provided they are defined in CoordinatedPatternGenerator and the units parameter is changed as appropriate.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [10, 20, 30, 40, 50, 60, 70, 80, 90, ... List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2scale(contrast_parameter=’w... HookList (0, None) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN relative_orientations [0.0, 0.5235987755982988, 0.785398163... List (0, None) V RW scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘size’, ‘x’, ‘y’] List (0, None) V RW subplot ‘’ String V RW x_axis ‘contrast’ String C RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. relative_orientations: < No docstring available > scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_axis: Parameter to use for the x axis of tuning curves.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘size’, ‘x’, ‘y’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01123>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2scale(contrast_parameter=’weber_contrast’, name=’contrast2scale01124’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=True, default=contrast, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.

param List relative_orientations (allow_None=False, bounds=(0, None), constant=False, default=[0.0, 0.5235987755982988, 0.7853981633974483, 1.5707963267948966], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[10, 20, 30, 40, 50, 60, 70, 80, 90, 100], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
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 0x2ad5f4536fc8>
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 0x2ad5f4892100>
inspect_value = <functools.partial object at 0x2ad5f4892158>
instance = <functools.partial object at 0x2ad5f4892208>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48925d0>
set_param = <functools.partial object at 0x2ad5f4892628>
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 featuremapper.command.measure_frequency_response(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(max_freq=Number, num_freq=Integer, coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measure spatial frequency preference of one unit of a sheet.

Uses an constant circular sine grating stimulus at the preferred with varying spatial frequency orientation and retinal position of the specified unit. Orientation and position preference must be calulated before measuring size response.

The curve can be plotted at various different values of the contrast (or actually any other parameter) of the stimulus. If using contrast and the network contains an LGN layer, then one would usually specify weber_contrast as the contrast_parameter. If there is no explicit LGN, then scale (offset=0.0) can be used to define the contrast. Other relevant contrast definitions (or other parameters) can also be used, provided they are defined in one of the appropriate metaparameter_fns.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [30, 60, 80, 90] List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW max_freq 10.0 Number (0.1, 50) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2scale(contrast_parameter=’w... HookList (0, None) V RW num_freq 21 Integer (1, 50) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘orientation’, ‘x’, ‘y’] List (0, None) V RW subplot ‘’ String V RW x_axis ‘frequency’ String C RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. max_freq: Maximum extent of the grating measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_freq: Number of different sizes to test. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_axis: Parameter to use for the x axis of tuning curves.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘orientation’, ‘x’, ‘y’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param Integer num_freq (allow_None=False, bounds=(1, None), constant=False, default=21, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of different sizes to test.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01123>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2scale(contrast_parameter=’weber_contrast’, name=’contrast2scale01124’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=True, default=frequency, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Number max_freq (allow_None=False, bounds=(0.1, None), constant=False, default=10.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Maximum extent of the grating
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
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 0x2ad5f48a9050>
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 0x2ad5f48a9158>
inspect_value = <functools.partial object at 0x2ad5f48a91b0>
instance = <functools.partial object at 0x2ad5f48a9260>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48a9628>
set_param = <functools.partial object at 0x2ad5f48a9680>
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 featuremapper.command.measure_or_tuning(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measures orientation tuning curve(s) of a particular unit.

Uses a circular sine grating patch as the stimulus on the retina.

The curve can be plotted at various different values of the contrast (or actually any other parameter) of the stimulus. If using contrast and the network contains an LGN layer, then one would usually specify weber_contrast as the contrast_parameter. If there is no explicit LGN, then scale (offset=0.0) can be used to define the contrast. Other relevant contrast definitions (or other parameters) can also be used, provided they are defined in CoordinatedPatternGenerator and the units parameter is changed as appropriate.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [30, 60, 80, 90] List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2scale(contrast_parameter=’w... HookList (0, None) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘size’, ‘x’, ‘y’] List (0, None) V RW subplot ‘’ String V RW x_axis ‘orientation’ String V RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_axis: Parameter to use for the x axis of tuning curves.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘size’, ‘x’, ‘y’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2scale(contrast_parameter=’weber_contrast’, name=’contrast2scale01124’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=orientation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01123>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f48ba0a8>
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 0x2ad5f48ba1b0>
inspect_value = <functools.partial object at 0x2ad5f48ba208>
instance = <functools.partial object at 0x2ad5f48ba2b8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48ba680>
set_param = <functools.partial object at 0x2ad5f48ba6d8>
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 featuremapper.command.measure_or_tuning_fullfield(**params)[source]

Bases: featuremapper.command.FeatureCurveCommand

params(coords=Parameter, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measures orientation tuning curve(s) of a particular unit using a full-field sine grating stimulus.

The curve can be plotted at various different values of the contrast (or actually any other parameter) of the stimulus. If using contrast and the network contains an LGN layer, then one would usually specify michelson_contrast as the contrast_parameter. If there is no explicit LGN, then scale (offset=0.0) can be used to define the contrast. Other relevant contrast definitions (or other parameters) can also be used, provided they are defined in CoordinatedPatternGenerator and the units parameter is changed as appropriate.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [30, 60, 80, 90] List (0, None) V RW coords None Parameter V RW AN durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW static_parameters [] List (0, None) V RW subplot ‘’ String V RW x_axis ‘orientation’ String V RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: Ignored; here just to suppress warning. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_axis: Parameter to use for the x axis of tuning curves.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Parameter coords (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Ignored; here just to suppress warning.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=orientation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01133>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
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 0x2ad5f48ce100>
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 0x2ad5f48ce208>
inspect_value = <functools.partial object at 0x2ad5f48ce260>
instance = <functools.partial object at 0x2ad5f48ce310>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48ce6d8>
set_param = <functools.partial object at 0x2ad5f48ce730>
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 featuremapper.command.measure_orientation_contrast(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(contrastcenter=Number, contrastsurround=List, orientation_center=Number, sizecenter=Number, sizesurround=Number, thickness=Number, coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measures the response to a center sine grating disk and a surround sine grating ring at different contrasts of the central disk.

The central disk is set to the preferred orientation of the unit to be measured. The surround disk orientation (relative to the central grating) and contrast can be varied, as can the size of both disks.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrastcenter 100 Number (0, 100) V RW contrasts [30, 60, 80, 90] List (0, None) V RW contrastsurround [30, 60, 80, 90] List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2centersurroundscale(contras... HookList (0, None) V RW num_orientation 9 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW orientation_center 0.0 Number (0.0, 3.14159265359) V RW outputs [] List (0, None) V RW pattern_generator OrientationContrast(aspect_ratio=1.0,... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW sizecenter 0.5 Number (0, None) V RW sizesurround 1.0 Number (0, None) V RW static_parameters [‘x’, ‘y’, ‘sizecenter’, ‘sizesurroun... List (0, None) V RW subplot ‘’ String V RW thickness 0.5 Number (0, 1.5) V RW x_axis ‘orientationsurround’ String C RW

Parameter docstrings: =====================

contrastcenter: Contrast of the center. contrasts: < No docstring available > contrastsurround: Contrast of the surround. coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. orientation_center: Orientation of the center grating patch outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. sizecenter: The size of the central pattern to present. sizesurround: The size of the surround pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. thickness: Ring thickness. x_axis: Parameter to use for the x axis of tuning curves.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘x’, ‘y’, ‘sizecenter’, ‘sizesurround’, ‘orientationcenter’, ‘thickness’, ‘contrastcenter’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List contrastsurround (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Contrast of the surround.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<OrientationContrast OrientationContrast01135>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2centersurroundscale(contrast_parameter=’weber_contrast’, name=’contrast2centersurroundscale01134’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=True, default=orientationsurround, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=9, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param Number thickness (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=False, time_fn=<Time Time00001>)
Ring thickness.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Number sizecenter (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=False, time_fn=<Time Time00001>)
The size of the central pattern to present.
param Number sizesurround (allow_None=False, bounds=(0, None), constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
The size of the surround pattern to present.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param Number orientation_center (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Orientation of the center grating patch
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Number contrastcenter (allow_None=False, bounds=(0, 100), constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Contrast of the center.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
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 0x2ad5f48e2158>
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 0x2ad5f48e2260>
inspect_value = <functools.partial object at 0x2ad5f48e22b8>
instance = <functools.partial object at 0x2ad5f48e2368>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48e2730>
set_param = <functools.partial object at 0x2ad5f48e2788>
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 featuremapper.command.measure_position_pref(**params)[source]

Bases: featuremapper.command.PositionMeasurementCommand

params(divisions=Integer, size=Number, x_range=NumericTuple, y_range=NumericTuple, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Measure a position preference map by collating the response to patterns. Parameters of ‘measure_position_pref’ =====================================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

divisions 7 Integer (1, None) V RW durations [1.0] Parameter V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [<class ‘featuremapper.metaparams.con... HookList (0, None) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator Gaussian(aspect_ratio=1.0, bounds=Bou... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_MaxValue(name=’DSF_MaxValue01117’... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘scale’, ‘offset’, ‘size’] List (0, None) V RW subplot ‘’ String V RW x_range (-0.5, 0.5) NumericTuple V RW y_range (-0.5, 0.5) NumericTuple V RW

Parameter docstrings: =====================

divisions: The number of different positions to measure in X and in Y. durations: Times after presentation  begins at which to record a measurement. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Callable object that will present a parameter-controlled  pattern to a set of Sheets. For measuring position, the  pattern_presenter should be spatially localized, yet also able  to activate the appropriate neurons reliably. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_range: The range of X values to test. y_range: The range of Y values to test.

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_MaxValue DSF_MaxValue01117>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param NumericTuple x_range (allow_None=False, constant=False, default=(-0.5, 0.5), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of X values to test.
param Integer divisions (allow_None=False, bounds=(1, None), constant=False, default=7, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
The number of different positions to measure in X and in Y.
param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘scale’, ‘offset’, ‘size’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[<class ‘featuremapper.metaparams.contrast2scale’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param NumericTuple y_range (allow_None=False, constant=False, default=(-0.5, 0.5), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
The range of Y values to test.
param Callable pattern_generator (allow_None=False, constant=False, default=<Gaussian Gaussian01120>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. For measuring position, the pattern_presenter should be spatially localized, yet also able to activate the appropriate neurons reliably.
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 0x2ad5f48f4310>
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 0x2ad5f48f44c8>
inspect_value = <functools.partial object at 0x2ad5f48f45d0>
instance = <functools.partial object at 0x2ad5f48f46d8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f48f4d08>
set_param = <functools.partial object at 0x2ad5f48f4e10>
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 featuremapper.command.measure_size_response(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(max_size=Number, num_sizes=Integer, coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String)

Measure receptive field size of one unit of a sheet.

Uses an expanding circular sine grating stimulus at the preferred orientation and retinal position of the specified unit. Orientation and position preference must be calulated before measuring size response.

The curve can be plotted at various different values of the contrast (or actually any other parameter) of the stimulus. If using contrast and the network contains an LGN layer, then one would usually specify weber_contrast as the contrast_parameter. If there is no explicit LGN, then scale (offset=0.0) can be used to define the contrast. Other relevant contrast definitions (or other parameters) can also be used, provided they are defined in CoordinatedPatternGenerator and the units parameter is changed as appropriate.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [30, 60, 80, 90] List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW max_size 1.0 Number (0.1, 50) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2scale(contrast_parameter=’w... HookList (0, None) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW num_sizes 11 Integer (1, 50) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘orientation’, ‘x’, ‘y’] List (0, None) V RW subplot ‘’ String V RW x_axis ‘size’ String C RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. max_size: Maximum extent of the grating measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. num_sizes: Number of different sizes to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. x_axis: Parameter to use for the x axis of tuning curves.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘orientation’, ‘x’, ‘y’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01123>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2scale(contrast_parameter=’weber_contrast’, name=’contrast2scale01124’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=True, default=size, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.
param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param Number max_size (allow_None=False, bounds=(0.1, None), constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Maximum extent of the grating
param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
param Integer num_sizes (allow_None=False, bounds=(1, None), constant=False, default=11, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of different sizes to test.
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 0x2ad5f4901368>
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 0x2ad5f4901578>
inspect_value = <functools.partial object at 0x2ad5f4901680>
instance = <functools.partial object at 0x2ad5f4901788>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f4901db8>
set_param = <functools.partial object at 0x2ad5f4901ec0>
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 featuremapper.command.test_measure(**params)[source]

Bases: featuremapper.command.UnitCurveCommand

params(units=String, coords=List, size=Number, contrasts=List, x_axis=String, frequencies=List, num_orientation=Integer, num_phase=Integer, inputs=List, metafeature_fns=HookList, offset=Number, outputs=List, pattern_generator=Callable, pattern_response_fn=Callable, preference_fn=ClassSelector, preference_lookup_fn=Callable, scale=Number, static_parameters=List, subplot=String, durations=Parameter, measurement_prefix=String, name=String) Parameters of ‘test_measure’ ============================  Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

contrasts [30, 60, 80, 90] List (0, None) V RW coords [(0, 0)] List (0, None) V RW durations [1.0] Parameter V RW frequencies [2.4] List (0, None) V RW inputs [] List (0, None) V RW measurement_prefix ‘’ String V RW metafeature_fns [contrast2scale(contrast_parameter=’w... HookList (0, None) V RW num_orientation 12 Integer (1, 24) V RW num_phase 18 Integer (1, 48) V RW offset 0.0 Number (-1.0, 1.0) V RW outputs [] List (0, None) V RW pattern_generator SineGrating(bounds=BoundingBox(radius... Callable V RW pattern_response_fn None Callable V RW AN preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW preference_lookup_fn None Callable V RW AN scale 0.3 Number (0.0, 2.0) V RW size 0.5 Number (0, None) V RW static_parameters [‘size’, ‘x’, ‘y’] List (0, None) V RW subplot ‘’ String V RW units ‘ rad’ String V RW x_axis ‘contrast’ String C RW

Parameter docstrings: =====================

contrasts: < No docstring available > coords: List of coordinates of units to measure. durations: Times after presentation  begins at which to record a measurement. frequencies: Sine grating frequencies to test. inputs: Name of input supplied to the  metadata_fns to filter out desired input. measurement_prefix: Optional prefix to add to the name under which results are stored as  part of a measurement response. metafeature_fns: Metafeature_fns is a hooklist, which accepts any function, which applies  coordinated changes to a set of inputs based on some parameter or feature  value. Can be used to present different patterns to different inputs or  to control complex features like contrast. num_orientation: Number of orientations to test. num_phase: Number of phases to test. offset: Additive offset to input pattern. outputs: Name of output sources supplied  to metadata_fns to filter out desired output. pattern_generator: Pattern to be presented on the inputs. pattern_response_fn: Callable object that will present a parameter-controlled pattern to a  set of Sheets. Needs to be supplied by a subclass or in the call.  The attributes duration and apply_output_fns (if non-None) will  be set on this object, and it should respect those if possible. preference_fn: Function that will be used to analyze the distributions of unit  responses. preference_lookup_fn: Callable object that will look up a preferred feature values. scale: Multiplicative strength of input pattern. size: The size of the pattern to present. static_parameters: List of names of parameters of this class to pass to the  pattern_presenter as static parameters, i.e. values that will be fixed  to a single value during measurement. subplot: Name of map to register as a subplot, if any. units: < No docstring available > x_axis: Parameter to use for the x axis of tuning curves.

param List static_parameters (allow_None=False, bounds=(0, None), constant=False, default=[‘size’, ‘x’, ‘y’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of names of parameters of this class to pass to the pattern_presenter as static parameters, i.e. values that will be fixed to a single value during measurement.
param Callable preference_lookup_fn (allow_None=True, constant=False, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will look up a preferred feature values.
param Callable pattern_generator (allow_None=False, constant=False, default=<SineGrating SineGrating01123>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Pattern to be presented on the inputs.
param HookList metafeature_fns (allow_None=False, bounds=(0, None), constant=False, default=[contrast2scale(contrast_parameter=’weber_contrast’, name=’contrast2scale01124’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Metafeature_fns is a hooklist, which accepts any function, which applies coordinated changes to a set of inputs based on some parameter or feature value. Can be used to present different patterns to different inputs or to control complex features like contrast.
param Number size (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=False, time_fn=<Time Time00001>)
The size of the pattern to present.
param Number scale (allow_None=False, bounds=None, constant=False, default=0.3, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Multiplicative strength of input pattern.
param String x_axis (allow_None=False, basestring=<type ‘basestring’>, constant=True, default=contrast, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Parameter to use for the x axis of tuning curves.
param Integer num_orientation (allow_None=False, bounds=(1, None), constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of orientations to test.
param List outputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of output sources supplied to metadata_fns to filter out desired output.

param String units (allow_None=False, basestring=<type ‘basestring’>, constant=False, default= rad, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param Callable pattern_response_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Callable object that will present a parameter-controlled pattern to a set of Sheets. Needs to be supplied by a subclass or in the call. The attributes duration and apply_output_fns (if non-None) will be set on this object, and it should respect those if possible.
param List inputs (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Name of input supplied to the metadata_fns to filter out desired input.
param ClassSelector preference_fn (allow_None=False, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01119>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit responses.
param List frequencies (allow_None=False, bounds=(0, None), constant=False, default=[2.4], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Sine grating frequencies to test.
param Parameter durations (allow_None=False, constant=False, default=[1.0], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Times after presentation begins at which to record a measurement.
param String measurement_prefix (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional prefix to add to the name under which results are stored as part of a measurement response.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Additive offset to input pattern.

param List contrasts (allow_None=False, bounds=(0, None), constant=False, default=[30, 60, 80, 90], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)

param String subplot (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Name of map to register as a subplot, if any.
param List coords (allow_None=False, bounds=(0, None), constant=False, default=[(0, 0)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
List of coordinates of units to measure.
param Integer num_phase (allow_None=False, bounds=(1, None), constant=False, default=18, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Number of phases to test.
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 0x2ad5f4918368>
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 0x2ad5f49183c0>
inspect_value = <functools.partial object at 0x2ad5f4918470>
instance = <functools.partial object at 0x2ad5f4918520>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f49188e8>
set_param = <functools.partial object at 0x2ad5f4918940>
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.

distribution Module

Inheritance diagram of featuremapper.distribution

Distribution class

class featuremapper.distribution.DSF_BimodalPeaks(**params)[source]

Bases: featuremapper.distribution.DescriptiveBimodalStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the two peak values of distributions in the given matrix

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba208>
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 0x2ad5f52ba260>
inspect_value = <functools.partial object at 0x2ad5f52ba310>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

second_max_value_bin(d)

Return the bin with the second largest value. If there is one bin only, return it. This is not a correct result, however it is practical for plotting compatibility, and it will not mistakenly be claimed as secondary maximum, by forcing its selectivity to 0.0

second_peak(d)

Return preference and selectivity of the second peak in the distribution.

It is just the combination of second_peak_bin() and second_peak_selectivity(), with the advantage of avoiding a duplicate call of second_peak_bin(), if the user is interested in both preference and selectivity, as often is the case.

second_peak_bin(d)

Return the bin with the second peak in the distribution. Unlike second_max_value_bin(), it does not return a bin which is the second largest value, if laying on a wing of the first peak, the second peak is returned only if the distribution is truly multimodal. If it isn’t, return the first peak (for compatibility with numpy array type, and plotting compatibility), however the corresponding selectivity will be forced to 0.0

second_peak_selectivity(d)

Return the selectivity of the second peak in the distribution.

If the distribution has only one peak, return 0.0, and this value is also usefl to discriminate the validity of second_peak_bin()

second_selectivity(d)

Return the selectivity of the second largest value in the distribution. If there is one bin only, the selectivity is 0, since there is no second peack at all, and this value is also used to discriminate the validity of second_max_value_bin() Selectivity is computed in two ways depending on whether the variable is a cyclic, as in selectivity()

selectivity(d)

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba368>
set_param = <functools.partial object at 0x2ad5f52ba5d0>
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.

vector_sum(d)

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.DSF_BimodalVonMisesFit(**params)[source]

Bases: featuremapper.distribution.VonMisesStatisticFn

params(worst_fit=Number, selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the two modes of distributions in the given matrix, by fit with von Mises function

The results of the main mode are available in self.{preference,selectivity,good_of_fit}, while the second mode results are in the first element of the self.more_modes list, as a dictionary with keys preference,selectivity,good_of_fit.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW worst_fit 0.5 Number (0.0, 1.0) V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling worst_fit: Worst good-of-fitness value for accepting the distribution as mono- or bi-modal

param Number worst_fit (allow_None=False, bounds=(0.0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Worst good-of-fitness value for accepting the distribution as mono- or bi-modal
param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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.

fit_v2m(distribution)

computes the best fit of the bivariate von Mises function in the semi-circle. Return the tuple: (

orientation1_preference, orientation1_selectivity, goodness_of_fit1, orientation2_preference, orientation2_selectivity, goodness_of_fit2

) See fit_vm() for considerations about selectivity and goodness_of_fit

fit_vm(distribution)

computes the best fit of the monovariate von Mises function in the semi-circle. Return a tuple with the orientation preference, in the same range of axis_bounds, the orientation selectivity, and an estimate of the goodness-of-fit, as the variance of the predicted orientation preference. The selectivity is given by the bandwith parameter of the von Mises function, modified for compatibility with other selectivity computations in this class. The bandwith parameter is transposed in logaritmic scale, and is normalized by the maximum value for the number of bins in the distribution, in order to give roughly 1.0 for a distribution with one bin at 1.0 an all the other at 0.0, and 0.0 for uniform distributions. The normalizing factor of the selectivity is fit for the total number of bins, using fit parameters computed offline. There are conditions that prevents apriori the possibility to fit the distribution:

  • not enough bins, at least 4 are necessary
  • the distribution is too flat, below the noise level
and conditions of aposteriori failures:
  • “ier” flag returned by leastsq out of ( 1, 2, 3, 4 )
  • no estimated Jacobian around the solution
  • negative bandwith (the peak of the distribution is convex)

Note that these are the minimal conditions, their fulfillment does not warrant unimodality, is up to the user to check the goodness-of-fit value for an accurate acceptance of the fit.

force_new_dynamic_value = <functools.partial object at 0x2ad5f52ba5d0>
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 0x2ad5f52ba368>
inspect_value = <functools.partial object at 0x2ad5f52ba100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f52ba158>
set_param = <functools.partial object at 0x2ad5f52ba520>
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.

von2_mises(pars, x)

Compute a simplified bimodal von Mises function

Two superposed von Mises functions, with different peak and bandwith values

von_mises(pars, x)

Compute a simplified von Mises function.

Original formulation in Richard von Mises, “Wahrscheinlichkeitsrechnung und ihre Anwendungen in der Statistik und theoretischen Physik”, 1931, Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., ” Directional Statistics”, 1999, J. Wiley, p.36; http://en.wikipedia.org/wiki/Von_Mises_distribution The two differences are that this function is a continuous probability distribution on a semi-circle, while von Mises is on the full circle, and that the normalization factor, which is the inverse of the modified Bessel function of first kind and 0 degree in the original, is here a fit parameter.

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 featuremapper.distribution.DSF_MaxValue(**params)[source]

Bases: featuremapper.distribution.DescriptiveStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the peak value of the given distribution

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba520>
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 0x2ad5f52ba208>
inspect_value = <functools.partial object at 0x2ad5f52ba310>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

selectivity(d)

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba260>
set_param = <functools.partial object at 0x2ad5f52ba1b0>
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.

vector_sum(d)

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.DSF_TopTwoValues(**params)[source]

Bases: featuremapper.distribution.DescriptiveBimodalStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the two max values of distributions in the given matrix

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba1b0>
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 0x2ad5f52ba5d0>
inspect_value = <functools.partial object at 0x2ad5f52ba100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

second_max_value_bin(d)

Return the bin with the second largest value. If there is one bin only, return it. This is not a correct result, however it is practical for plotting compatibility, and it will not mistakenly be claimed as secondary maximum, by forcing its selectivity to 0.0

second_peak(d)

Return preference and selectivity of the second peak in the distribution.

It is just the combination of second_peak_bin() and second_peak_selectivity(), with the advantage of avoiding a duplicate call of second_peak_bin(), if the user is interested in both preference and selectivity, as often is the case.

second_peak_bin(d)

Return the bin with the second peak in the distribution. Unlike second_max_value_bin(), it does not return a bin which is the second largest value, if laying on a wing of the first peak, the second peak is returned only if the distribution is truly multimodal. If it isn’t, return the first peak (for compatibility with numpy array type, and plotting compatibility), however the corresponding selectivity will be forced to 0.0

second_peak_selectivity(d)

Return the selectivity of the second peak in the distribution.

If the distribution has only one peak, return 0.0, and this value is also usefl to discriminate the validity of second_peak_bin()

second_selectivity(d)

Return the selectivity of the second largest value in the distribution. If there is one bin only, the selectivity is 0, since there is no second peack at all, and this value is also used to discriminate the validity of second_max_value_bin() Selectivity is computed in two ways depending on whether the variable is a cyclic, as in selectivity()

selectivity(d)

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba158>
set_param = <functools.partial object at 0x2ad5f52ba2b8>
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.

vector_sum(d)

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.DSF_VonMisesFit(**params)[source]

Bases: featuremapper.distribution.VonMisesStatisticFn

params(worst_fit=Number, selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the main mode of distribution in the given matrix, by fit with von Mises function.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW worst_fit 0.5 Number (0.0, 1.0) V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling worst_fit: worst good-of-fitness value for accepting the distribution as monomodal

param Number worst_fit (allow_None=False, bounds=(0.0, None), constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
worst good-of-fitness value for accepting the distribution as monomodal
param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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.

fit_v2m(distribution)

computes the best fit of the bivariate von Mises function in the semi-circle. Return the tuple: (

orientation1_preference, orientation1_selectivity, goodness_of_fit1, orientation2_preference, orientation2_selectivity, goodness_of_fit2

) See fit_vm() for considerations about selectivity and goodness_of_fit

fit_vm(distribution)

computes the best fit of the monovariate von Mises function in the semi-circle. Return a tuple with the orientation preference, in the same range of axis_bounds, the orientation selectivity, and an estimate of the goodness-of-fit, as the variance of the predicted orientation preference. The selectivity is given by the bandwith parameter of the von Mises function, modified for compatibility with other selectivity computations in this class. The bandwith parameter is transposed in logaritmic scale, and is normalized by the maximum value for the number of bins in the distribution, in order to give roughly 1.0 for a distribution with one bin at 1.0 an all the other at 0.0, and 0.0 for uniform distributions. The normalizing factor of the selectivity is fit for the total number of bins, using fit parameters computed offline. There are conditions that prevents apriori the possibility to fit the distribution:

  • not enough bins, at least 4 are necessary
  • the distribution is too flat, below the noise level
and conditions of aposteriori failures:
  • “ier” flag returned by leastsq out of ( 1, 2, 3, 4 )
  • no estimated Jacobian around the solution
  • negative bandwith (the peak of the distribution is convex)

Note that these are the minimal conditions, their fulfillment does not warrant unimodality, is up to the user to check the goodness-of-fit value for an accurate acceptance of the fit.

force_new_dynamic_value = <functools.partial object at 0x2ad5f52ba520>
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 0x2ad5f52ba158>
inspect_value = <functools.partial object at 0x2ad5f52ba208>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f52ba310>
set_param = <functools.partial object at 0x2ad5f52ba050>
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.

von2_mises(pars, x)

Compute a simplified bimodal von Mises function

Two superposed von Mises functions, with different peak and bandwith values

von_mises(pars, x)

Compute a simplified von Mises function.

Original formulation in Richard von Mises, “Wahrscheinlichkeitsrechnung und ihre Anwendungen in der Statistik und theoretischen Physik”, 1931, Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., ” Directional Statistics”, 1999, J. Wiley, p.36; http://en.wikipedia.org/wiki/Von_Mises_distribution The two differences are that this function is a continuous probability distribution on a semi-circle, while von Mises is on the full circle, and that the normalization factor, which is the inverse of the modified Bessel function of first kind and 0 degree in the original, is here a fit parameter.

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 featuremapper.distribution.DSF_WeightedAverage(**params)[source]

Bases: featuremapper.distribution.DescriptiveStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Return the main mode of the given distribution

The prefence value ia a continuous, interpolated equivalent of the max_value_bin(). For a cyclic distribution, this is the direction of the vector sum (see vector_sum()). For a non-cyclic distribution, this is the arithmetic average of the data on the bin_axis, where each bin is weighted by its value. Such a computation will generally produce much more precise maps using fewer test stimuli than the discrete method. However, weighted_average methods generally require uniform and full-range sampling, which is not always feasible. For measurements at evenly-spaced intervals over the full range of possible parameter values, weighted_averages are a good measure of the underlying continuous-valued parameter preference, assuming that neurons are tuned broadly enough (and/or sampled finely enough) that they respond to at least two of the tested parameter values. This method will not usually give good results when those criteria are not met, i.e. if the sampling is too sparse, not at evenly-spaced intervals, or does not cover the full range of possible values. In such cases max_value_bin should be used, and the number of test patterns will usually need to be increased instead.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba5d0>
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 0x2ad5f52ba1b0>
inspect_value = <functools.partial object at 0x2ad5f52ba100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

selectivity(d)

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba368>
set_param = <functools.partial object at 0x2ad5f52ba2b8>
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.

vector_sum(d)

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.DescriptiveBimodalStatisticFn(**params)[source]

Bases: featuremapper.distribution.DescriptiveStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Abstract class for descriptive statistics of two-modes distributions

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba2b8>
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 0x2ad5f52ba368>
inspect_value = <functools.partial object at 0x2ad5f52ba520>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

second_max_value_bin(d)[source]

Return the bin with the second largest value. If there is one bin only, return it. This is not a correct result, however it is practical for plotting compatibility, and it will not mistakenly be claimed as secondary maximum, by forcing its selectivity to 0.0

second_peak(d)[source]

Return preference and selectivity of the second peak in the distribution.

It is just the combination of second_peak_bin() and second_peak_selectivity(), with the advantage of avoiding a duplicate call of second_peak_bin(), if the user is interested in both preference and selectivity, as often is the case.

second_peak_bin(d)[source]

Return the bin with the second peak in the distribution. Unlike second_max_value_bin(), it does not return a bin which is the second largest value, if laying on a wing of the first peak, the second peak is returned only if the distribution is truly multimodal. If it isn’t, return the first peak (for compatibility with numpy array type, and plotting compatibility), however the corresponding selectivity will be forced to 0.0

second_peak_selectivity(d)[source]

Return the selectivity of the second peak in the distribution.

If the distribution has only one peak, return 0.0, and this value is also usefl to discriminate the validity of second_peak_bin()

second_selectivity(d)[source]

Return the selectivity of the second largest value in the distribution. If there is one bin only, the selectivity is 0, since there is no second peack at all, and this value is also used to discriminate the validity of second_max_value_bin() Selectivity is computed in two ways depending on whether the variable is a cyclic, as in selectivity()

selectivity(d)

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba208>
set_param = <functools.partial object at 0x2ad5f52ba578>
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.

vector_sum(d)

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.DescriptiveStatisticFn(**params)[source]

Bases: featuremapper.distribution.DistributionStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Abstract class for basic descriptive statistics

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba5d0>
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 0x2ad5f52ba208>
inspect_value = <functools.partial object at 0x2ad5f52ba1b0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

selectivity(d)[source]

Return a measure of the peakedness of the distribution. The calculation differs depending on whether this is a cyclic variable. For a cyclic variable, returns the magnitude of the vector_sum() divided by the sum_value() (see _vector_selectivity for more details). For a non-cyclic variable, returns the max_value_bin()) as a proportion of the sum_value() (see _relative_selectivity for more details).

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 0x2ad5f52ba100>
set_param = <functools.partial object at 0x2ad5f52ba310>
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.

vector_sum(d)[source]

Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).

Each bin contributes a vector of length equal to its value, at a direction corresponding to the bin number. Specifically, the total bin number range is mapped into a direction range [0,2pi].

For a cyclic distribution, the avgbinnum will be a continuous measure analogous to the max_value_bin() of the distribution. But this quantity has more precision than max_value_bin() because it is computed from the entire distribution instead of just the peak bin. However, it is likely to be useful only for uniform or very dense sampling; with sparse, non-uniform sampling the estimates will be biased significantly by the particular samples chosen.

The avgbinnum is not meaningful when the magnitude is 0, because a zero-length vector has no direction. To find out whether such cases occurred, you can compare the value of undefined_vals before and after a series of calls to this function.

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 featuremapper.distribution.Distribution(axis_bounds=(0.0, 6.283185307179586), cyclic=False, keep_peak=False)[source]

Bases: object

Holds a distribution of the values f(x) associated with a variable x.

A Distribution is a histogram-like object that is a dictionary of samples. Each sample is an x:f(x) pair, where x is called the bin and f(x) is called the value(). Each bin’s value is typically maintained as the sum of all the values that have been placed into it.

The bin axis is continuous, and can represent a continuous quantity without discretization. Alternatively, this class can be used as a traditional histogram by either discretizing the bin number before adding each sample, or by binning the values in the final Distribution.

Distributions are bounded by the specified axis_bounds, and can either be cyclic (like directions or hues) or non-cyclic. For cyclic distributions, samples provided outside the axis_bounds will be wrapped back into the bound range, as is appropriate for quantities like directions. For non-cyclic distributions, providing samples outside the axis_bounds will result in a ValueError.

In addition to the values, can also return the counts, i.e., the number of times that a sample has been added with the given bin.

Not all instances of this class will be a true distribution in the mathematical sense; e.g. the values will have to be normalized before they can be considered a probability distribution.

If keep_peak=True, the value stored in each bin will be the maximum of all values ever added, instead of the sum. The distribution will thus be a record of the maximum value seen at each bin, also known as an envelope.

add(new_data)[source]

Add a set of new data in the form of a dictionary of (bin, value) pairs. If the bin already exists, the value is added to the current value. If the bin doesn’t exist, one is created with that value.

Bin numbers outside axis_bounds are allowed for cyclic=True, but otherwise a ValueError is raised.

If keep_peak=True, the value of the bin is the maximum of the current value and the supplied value. That is, the bin stores the peak value seen so far. Note that each call will increase the total_value and total_count (and thus decrease the value_mag() and count_mag()) even if the value doesn’t happen to be the maximum seen so far, since each data point still helps improve the sampling and thus the confidence.

bins()[source]

Return a list of bins that have been populated.

count_mag(bin)[source]

Return the count of a single bin as a proportion of total_count.

counts()[source]

Return a list of values.

Various statistics can then be calculated if desired:

sum(counts) (total of all counts) max(counts) (highest count in any bin)

Note that the bin-order of values returned does not necessarily match that returned by values().

get_count(bin)[source]

Return the count from the specified bin.

(Return None if there is no such bin.)

get_value(bin)[source]

Return the value of the specified bin.

(Return None if there is no such bin.)

max_value_bin()[source]

Return the bin with the largest value.

sub_distr(distr)[source]

Subtract the given distribution from the current one. Only existing bins are modified, new bins in the given distribution are discarded without raising errors.

Note that total_value and total_count are not affected, and keep_peak is ignored, therefore analysis relying on these values should not call this method.

value_mag(bin)[source]

Return the value of a single bin as a proportion of total_value.

values()[source]

Return a list of values.

Various statistics can then be calculated if desired:

sum(vals) (total of all values) max(vals) (highest value in any bin)

Note that the bin-order of values returned does not necessarily match that returned by counts().

weighted_sum()[source]

Return the sum of each value times its bin.

class featuremapper.distribution.DistributionStatisticFn(**params)[source]

Bases: param.parameterized.Parameterized

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Base class for various functions performing statistics on a distribution.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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 0x2ad5f52ba2b8>
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 0x2ad5f52ba310>
inspect_value = <functools.partial object at 0x2ad5f52ba520>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f52ba158>
set_param = <functools.partial object at 0x2ad5f52ba628>
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 featuremapper.distribution.Pref(**args)[source]

Bases: dict

This class simply collects named arguments into a dictionary

the main purpose is to make pretty readable the output of DistributionStatisticFn functions. In addition, trap missing keys

clear() → None. Remove all items from D.
copy() → a shallow copy of D
static fromkeys(S[, v]) → New dict with keys from S and values equal to v.

v defaults to None.

get(k[, d]) → D[k] if k in D, else d. d defaults to None.
has_key(k) → True if D has a key k, else False
items() → list of D's (key, value) pairs, as 2-tuples
iteritems() → an iterator over the (key, value) items of D
iterkeys() → an iterator over the keys of D
itervalues() → an iterator over the values of D
keys() → list of D's keys
pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised

popitem() → (k, v), remove and return some (key, value) pair as a

2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) → None. Update D from dict/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → list of D's values
viewitems() → a set-like object providing a view on D's items
viewkeys() → a set-like object providing a view on D's keys
viewvalues() → an object providing a view on D's values
class featuremapper.distribution.VonMisesStatisticFn(**params)[source]

Bases: featuremapper.distribution.DistributionStatisticFn

params(selectivity_scale=NumericTuple, value_scale=NumericTuple, name=String)

Base class for von Mises statistics

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

selectivity_scale (0.0, 1.0) NumericTuple V RW value_scale (0.0, 1.0) NumericTuple V RW

Parameter docstrings: =====================

selectivity_scale: Scaling of the resulting measure of the distribution peakedness,  typically the selectivity of a unit to its preferred feature value.  The tuple specifies (offset, multiplier) of the output scaling value_scale: Scaling of the resulting value of the distribution statistics,  typically the preference of a unit to feature values. The tuple  specifies (offset, multiplier) of the output scaling

param NumericTuple selectivity_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting measure of the distribution peakedness, typically the selectivity of a unit to its preferred feature value. The tuple specifies (offset, multiplier) of the output scaling
param NumericTuple value_scale (allow_None=False, constant=False, default=(0.0, 1.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Scaling of the resulting value of the distribution statistics, typically the preference of a unit to feature values. The tuple specifies (offset, multiplier) of the output scaling
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.

fit_v2m(distribution)[source]

computes the best fit of the bivariate von Mises function in the semi-circle. Return the tuple: (

orientation1_preference, orientation1_selectivity, goodness_of_fit1, orientation2_preference, orientation2_selectivity, goodness_of_fit2

) See fit_vm() for considerations about selectivity and goodness_of_fit

fit_vm(distribution)[source]

computes the best fit of the monovariate von Mises function in the semi-circle. Return a tuple with the orientation preference, in the same range of axis_bounds, the orientation selectivity, and an estimate of the goodness-of-fit, as the variance of the predicted orientation preference. The selectivity is given by the bandwith parameter of the von Mises function, modified for compatibility with other selectivity computations in this class. The bandwith parameter is transposed in logaritmic scale, and is normalized by the maximum value for the number of bins in the distribution, in order to give roughly 1.0 for a distribution with one bin at 1.0 an all the other at 0.0, and 0.0 for uniform distributions. The normalizing factor of the selectivity is fit for the total number of bins, using fit parameters computed offline. There are conditions that prevents apriori the possibility to fit the distribution:

  • not enough bins, at least 4 are necessary
  • the distribution is too flat, below the noise level
and conditions of aposteriori failures:
  • “ier” flag returned by leastsq out of ( 1, 2, 3, 4 )
  • no estimated Jacobian around the solution
  • negative bandwith (the peak of the distribution is convex)

Note that these are the minimal conditions, their fulfillment does not warrant unimodality, is up to the user to check the goodness-of-fit value for an accurate acceptance of the fit.

force_new_dynamic_value = <functools.partial object at 0x2ad5f52ba208>
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 0x2ad5f52ba5d0>
inspect_value = <functools.partial object at 0x2ad5f52ba1b0>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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 0x2ad5f52ba100>
set_param = <functools.partial object at 0x2ad5f52ba050>
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.

von2_mises(pars, x)[source]

Compute a simplified bimodal von Mises function

Two superposed von Mises functions, with different peak and bandwith values

von_mises(pars, x)[source]

Compute a simplified von Mises function.

Original formulation in Richard von Mises, “Wahrscheinlichkeitsrechnung und ihre Anwendungen in der Statistik und theoretischen Physik”, 1931, Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., ” Directional Statistics”, 1999, J. Wiley, p.36; http://en.wikipedia.org/wiki/Von_Mises_distribution The two differences are that this function is a continuous probability distribution on a semi-circle, while von Mises is on the full circle, and that the normalization factor, which is the inverse of the modified Bessel function of first kind and 0 degree in the original, is here a fit parameter.

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.

featuremapper.distribution.arg(z)[source]

Return the complex argument (phase) of z. (z in radians.)

featuremapper.distribution.wrap(lower, upper, x)[source]

Circularly alias the numeric value x into the range [lower,upper).

Valid for cyclic quantities like orientations or hues.

features Module

Inheritance diagram of featuremapper.features

class featuremapper.features.Feature(name, **params)[source]

Bases: holoviews.core.dimension.Dimension

params(compute_fn=Callable, offset=Number, preference_fn=ClassSelector, steps=Integer, cyclic=Boolean, range=Tuple, soft_range=Tuple, type=Parameter, unit=String, value_format=Callable, values=ClassSelector, name=String)

Specifies several parameters required for generating a map of one input feature.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Bounds Mode 

compute_fn None Callable V RW AN cyclic False Boolean (0, 1) V RW offset 0.0 Number V RW preference_fn DSF_WeightedAverage(name=’DSF_Weighte... ClassSelector V RW AN range (None, None) Tuple V RW soft_range (None, None) Tuple V RW steps 0 Integer V RW type None Parameter V RW AN unit None String V RW AN value_format None Callable V RW AN values [] ClassSelector V RW

Parameter docstrings: =====================

compute_fn: If non-None, a function that when given a list of other parameter  values, computes and returns the value for this feature. cyclic: Whether the range of this feature is cyclic such that the  maximum allowed value (defined by the range parameter) is  continuous with the minimum allowed value. offset: Offset to add to the values for this feature preference_fn: Function that will be used to analyze the distributions of unit response  to this feature. range: Specifies the minimum and maximum allowed values for a  Dimension. None is used to represent an unlimited bound. soft_range: Specifies a minimum and maximum reference value, which  may be overridden by the data. steps: Number of steps, between lower and upper range value, to be presented. type: Optional type associated with the Dimension values. The type  may be an inbuilt constructor (such as int, str, float) or a  custom class object. unit: Optional unit string associated with the Dimension. For  instance, the string ‘m’ may be used represent units of meters  and ‘s’ to represent units of seconds. value_format: Formatting function applied to each value before display. values: Optional set of allowed values for the dimension that can also  be used to retain a categorical ordering. Setting values to  ‘initial’ indicates that the values will be added during construction.

param ClassSelector preference_fn (allow_None=True, constant=False, default=<DSF_WeightedAverage DSF_WeightedAverage01030>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function that will be used to analyze the distributions of unit response to this feature.
param Boolean cyclic (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether the range of this feature is cyclic such that the maximum allowed value (defined by the range parameter) is continuous with the minimum allowed value.
param Callable compute_fn (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
If non-None, a function that when given a list of other parameter values, computes and returns the value for this feature.
param Tuple soft_range (allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Specifies a minimum and maximum reference value, which may be overridden by the data.
param Tuple range (allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False)
Specifies the minimum and maximum allowed values for a Dimension. None is used to represent an unlimited bound.
param ClassSelector values (allow_None=False, constant=False, default=[], instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Optional set of allowed values for the dimension that can also be used to retain a categorical ordering. Setting values to ‘initial’ indicates that the values will be added during construction.
param Number offset (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=False, time_fn=<Time Time00001>)
Offset to add to the values for this feature
param Integer steps (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=False, time_fn=<Time Time00001>)
Number of steps, between lower and upper range value, to be presented.
param Parameter type (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional type associated with the Dimension values. The type may be an inbuilt constructor (such as int, str, float) or a custom class object.
param String unit (allow_None=True, basestring=<type ‘basestring’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Optional unit string associated with the Dimension. For instance, the string ‘m’ may be used represent units of meters and ‘s’ to represent units of seconds.
param Callable value_format (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Formatting function applied to each value before display.
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 0x2ad5f5272260>
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 0x2ad5f52722b8>
inspect_value = <functools.partial object at 0x2ad5f5272208>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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.

pprint_label

The pretty-printed label string for the Dimension

pprint_value(value)

Applies the defined formatting to the value.

pprint_value_string(value)

Pretty prints the dimension name and value using the global title_format variable, including the unit string (if set). Numeric types are printed to the stated rounding level.

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 0x2ad5f52723c0>
set_param = <functools.partial object at 0x2ad5f5272418>
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.

metaparams Module

Inheritance diagram of featuremapper.metaparams

Metaparameter functions allow for the presentation of complex patterns that are coordinated across different inputs (controlled via the input name) or controlled by a higher-level parameter.

Current examples are transformations of contrast between the stimulus and the background based on a contrast parameter, which can be set to implement Michelson or Weber contrast or the coordinated presentation of input patterns to each eye, which assigns the correct input pattern based on whether an input source contains ‘left’ or ‘right’.

class featuremapper.metaparams.contrast2centersurroundscale(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(contrast_parameter=String, name=String)

Allows controlling the contrast in orientation contrast patterns, where the contrast of the central stimulus has to be set independently from the surround annulus and the background. Can be controlled with the contrast_parameter, which can be set to one of three values: ‘michelson_contrast’, ‘weber_contrast’ or simply ‘scale’.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

contrast_parameter ‘weber_contrast’ String V RW

Parameter docstrings: =====================

contrast_parameter: < No docstring available >

param String contrast_parameter (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=weber_contrast, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

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 0x2ad5f5172368>
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 0x2ad5f51721b0>
inspect_value = <functools.partial object at 0x2ad5f5172470>
instance = <functools.partial object at 0x2ad5f51724c8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172418>
set_param = <functools.partial object at 0x2ad5f51725d0>
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 featuremapper.metaparams.contrast2scale(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(contrast_parameter=String, name=String)

Coordinates complex contrast values in single and compound patterns. To change the contrast behavior change the contrast_parameter to one of three values: ‘michelson_contrast’, ‘weber_contrast’ or simply ‘scale’.

 Parameters changed from their default values are marked in red. Soft bound values are marked in cyan. C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name Value Type Mode 

contrast_parameter ‘michelson_contrast’ String V RW

Parameter docstrings: =====================

contrast_parameter: < No docstring available >

param String contrast_parameter (allow_None=False, basestring=<type ‘basestring’>, constant=False, default=michelson_contrast, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

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 0x2ad5f5172208>
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 0x2ad5f5172368>
inspect_value = <functools.partial object at 0x2ad5f5172260>
instance = <functools.partial object at 0x2ad5f51722b8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172100>
set_param = <functools.partial object at 0x2ad5f5172628>
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 featuremapper.metaparams.hue2rgbscale(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(name=String)

Coordinates hue between inputs with Red, Green or Blue in their name.

 Object has no parameters.

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 0x2ad5f51721b0>
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 0x2ad5f5172470>
inspect_value = <functools.partial object at 0x2ad5f51723c0>
instance = <functools.partial object at 0x2ad5f5172418>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172520>
set_param = <functools.partial object at 0x2ad5f5172578>
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 featuremapper.metaparams.phasedisparity2leftrightphase(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(name=String)

Coordinates phase disparity between two eyes, by looking for the keywords Left and Right in the input names.

 Object has no parameters.

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 0x2ad5f5172260>
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 0x2ad5f51721b0>
inspect_value = <functools.partial object at 0x2ad5f5172158>
instance = <functools.partial object at 0x2ad5f5172100>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172368>
set_param = <functools.partial object at 0x2ad5f51724c8>
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 featuremapper.metaparams.direction2translation(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(name=String)

Coordinates the presentation of moving patterns. Currently supports an old and new motion model.

 Object has no parameters.

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 0x2ad5f5172520>
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 0x2ad5f5172680>
inspect_value = <functools.partial object at 0x2ad5f51725d0>
instance = <functools.partial object at 0x2ad5f51726d8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172aa0>
set_param = <functools.partial object at 0x2ad5f5172af8>
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 featuremapper.metaparams.ocular2leftrightscale(**params)[source]

Bases: param.parameterized.ParameterizedFunction

params(name=String)

Coordinates patterns between two eyes, by looking for the keywords Left and Right in the input names.

 Object has no parameters.

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 0x2ad5f51726d8>
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 0x2ad5f5172890>
inspect_value = <functools.partial object at 0x2ad5f5172788>
instance = <functools.partial object at 0x2ad5f51728e8>
message(msg, *args, **kw)

Print msg merged with args as a message.

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

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='n ', unknown_value='<?>', qualify=False, separator='')

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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 0x2ad5f5172100>
set_param = <functools.partial object at 0x2ad5f51722b8>
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.