A family of function objects for transforming a matrix generated from some other function.
Output functions are useful for neuron activation functions, normalization of matrices, etc. They come in two varieties: OutputFunction, and CFPOutputFunction. An OutputFunction (e.g. PiecewiseLinear) applies to one matrix of any type, such as an activity matrix or a set of weights. To apply an OutputFunction to all of the weight matrices in an entire CFProjection, an OutputFunction can be plugged in to CFPOF_Plugin. CFPOF_Plugin is one example of a CFPOutputFunction, which is a function that works with the entire Projection at once.
Any new output functions added to this directory will automatically become available for any model.
Bases: imagen.transferfn.TransferFn
Abstract base class for TransferFns that need to maintain a self.plastic parameter.
These TransferFns typically maintain some form of internal history or other state from previous calls, which can be disabled by override_plasticity_state().
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the state saved by the most recent state_push call.
Save the current state onto a stack, to be restored with state_pop.
Subclasses must implement state_push and state_pop to store state across invocations. The behaviour should be such that after state_pop, the state is restored to what it was at the time when state_push was called.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState, numbergen.TimeAwareRandomState
Abstract base class for TransferFns that use a random state. Inherits time-dependent control of the random state from numbergen.TimeAwareRandomState. Consult the help of TimeAwareRandomState for more information.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Save the current random number generator (onto the stack), replacing it with a copy.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Transfer function that applies a half-wave rectification (i.e., clips at zero), and then raises the result to the e-th power (where the exponent e can be selected arbitrarily).
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.transferfn.TransferFnWithRandomState
Simulate Poisson-distributed activity with specified mean values.
This transfer function interprets each matrix value as the (potentially scaled) rate of a Poisson process and replaces it with a sample from the appropriate Poisson distribution.
To allow the matrix to contain values in a suitable range (such as [0.0,1.0]), the input matrix is scaled by the parameter in_scale, and the baseline_rate is added before sampling. After sampling, the output value is then scaled by out_scale. The function thus performs this transformation:
x <- P(in_scale * x + baseline_rate) * out_scale
where x is a matrix value and P(r) samples from a Poisson distribution with rate r.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Retrieve the previous random number generator from the stack.
Save the current random number generator (onto the stack), replacing it with a copy.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState
Scales input activity based on the current average activity (x_avg).
The scaling is calculated to bring x_avg for each unit closer to a specified target average. Calculates a scaling factor that is greater than 1 if x_avg is less than the target and less than 1 if x_avg is greater than the target, and multiplies the input activity by this scaling factor.
The plastic parameter allows the updating of the average values to be disabled temporarily, e.g. while presenting test patterns.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the state saved by the most recent state_push call.
Save the current state onto a stack, to be restored with state_pop.
Subclasses must implement state_push and state_pop to store state across invocations. The behaviour should be such that after state_pop, the state is restored to what it was at the time when state_push was called.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Piecewise-linear TransferFn with lower and upper thresholds.
Values below the lower_threshold are set to zero, those above the upper threshold are set to 1.0, and those in between are scaled linearly.
param Number lower_bound (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=True, time_fn=<Time Time00001>)
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
param Number upper_bound (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: param.parameterized.Parameterized
Function object to modify a matrix in place, e.g. for normalization.
Used for transforming an array of intermediate results into a final version, by cropping it, normalizing it, squaring it, etc.
Objects in this class must support being called as a function with one matrix argument, and are expected to change that matrix in place.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Identity function, returning its argument as-is.
For speed, calling this function object is sometimes optimized away entirely. To make this feasible, it is not allowable to derive other classes from this object, modify it to have different behavior, add side effects, or anything of that nature.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState
Smoothly interpolates a matrix between simulation time steps, with exponential falloff.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
TransferFn that divides an array by its L1 norm.
This operation ensures that the sum of the absolute values of the array is equal to the specified norm_value, rescaling each value to make this true. The array is unchanged if the sum of absolute values is zero. For arrays of non-negative values where at least one is non-zero, this operation is equivalent to a divisive sum normalization.
param Number norm_value (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
TransferFn to divide an array by its Euclidean length (aka its L2 norm).
For a given array interpreted as a flattened vector, keeps the Euclidean length of the vector at a specified norm_value.
param Number norm_value (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.transferfn.TransferFnWithRandomState
Implementation of homeostatic intrinsic plasticity from Jochen Triesch, ICANN 2005, LNCS 3696 pp.65-70.
A sigmoid activation function is adapted automatically to achieve desired average firing rate and approximately exponential distribution of firing rates (for the maximum possible entropy).
Note that this TransferFn has state, so the history of calls to it will affect future behavior. The plastic parameter can be used to disable changes to the state.
Also calculates average activity as useful debugging information, for use with AttributeTrackingTF. Average activity is calculated as an exponential moving average with a smoothing factor (smoothing). For more information see: NIST/SEMATECH e-Handbook of Statistical Methods, Single Exponential Smoothing http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc431.htm
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Forces all values below a threshold to zero, and above it to 1.0.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState
Calculates the average of the input activity.
The average is calculated as an exponential moving average, where the weighting for each older data point decreases exponentially. The degree of weighing for the previous values is expressed as a constant smoothing factor.
The plastic parameter allows the updating of the average values to be disabled temporarily, e.g. while presenting test patterns.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the state saved by the most recent state_push call.
Save the current state onto a stack, to be restored with state_pop.
Subclasses must implement state_push and state_pop to store state across invocations. The behaviour should be such that after state_pop, the state is restored to what it was at the time when state_push was called.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Transfer function that is exponential until t from which point it is linear.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
TransferFn to divide an array by its L-infinity norm (i.e. the maximum absolute value of its elements).
For a given array interpreted as a flattened vector, scales the elements divisively so that the maximum absolute value is the specified norm_value.
The L-infinity norm is also known as the divisive infinity norm and Chebyshev norm.
param Number norm_value (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
The generalized logistic curve (Richards’ curve): y = l + (u /(1 + b * exp(-r*(x-2*m))^(1/b))).
The logistic curve is a flexible function for specifying a nonlinear growth curve using five parameters:
From Richards, F.J. (1959), A flexible growth function for empirical use. J. Experimental Botany 10: 290–300. http://en.wikipedia.org/wiki/Generalised_logistic_curve
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Transfer function that applies a squaring nonlinearity.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Sigmoidal (logistic) transfer function: 1/(1+exp-(r*x+k)).
As defined in Jochen Triesch, ICANN 2005, LNCS 3696 pp. 65-70. The parameters control the growth rate (r) and the x position (k) of the exponential.
This function is a special case of the GeneralizedLogistic function, with parameters r=r, l=0, u=1, m=-k/2r, and b=1. See Richards, F.J. (1959), A flexible growth function for empirical use. J. Experimental Botany 10: 290–300, 1959. http://en.wikipedia.org/wiki/Generalised_logistic_curve
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Transfer function that applies a half-wave rectification (clips at zero) and then squares the values.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Naka-Rushton curve.
From Naka, K. and Rushton, W. (1996), S-potentials from luminosity units in the retina of fish (Cyprinidae). J. Physiology 185:587-599.
The Naka-Rushton curve has been shown to be a good approximation of constrast gain control in cortical neurons. The input of the curve is usually contrast, but under the assumption that the firing rate of a model neuron is directly proportional to the contrast, it can be used as a TransferFn for a Sheet.
The parameter c50 corresponds to the contrast at which the half of the maximal output is reached. For a Sheet TransferFn this translates to the input for which a neuron will respond with activity 0.5.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Forces all values below a threshold to zero, and leaves others unchanged.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
TransferFn to divide an array by its Lp-Norm, where p is specified.
For a parameter p and a given array interpreted as a flattened vector, keeps the Lp-norm of the vector at a specified norm_value. Faster versions are provided separately for the typical L1-norm and L2-norm cases. Defaults to be the same as an L2-norm, i.e., DivisiveNormalizeL2.
param Number p (allow_None=False, bounds=None, constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
param Number norm_value (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Transfer functions with more complex dependencies.
$Id: basic.py 10790 2009-11-21 17:51:33Z antolikjan $
Bases: imagen.transferfn.TransferFn
Combine the supplied pattern with one generated using a PatternGenerator.
Useful for operations like adding noise or masking out lesioned items or around the edges of non-rectangular shapes.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
alias of AdaptiveThreshold
Bases: imagen.transferfn.TransferFn
Replaces the given matrix with a kernel function centered around the maximum value.
This operation is usually part of the Kohonen SOM algorithm, and approximates a series of lateral interactions resulting in a single activity bubble.
The radius of the kernel (i.e. the surround) is specified by the parameter ‘radius’, which should be set before using __call__. The shape of the surround is determined by the neighborhood_kernel_generator, and can be any PatternGenerator instance, or any function accepting bounds, density, radius, and height to return a kernel matrix.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState
Adapts the parameters of a linear threshold function to maintain a constant desired average activity. Defined in:
Jean-Luc R. Stevens, Judith S. Law, Jan Antolik, and James A. Bednar. Mechanisms for stable, robust, and adaptive development of orientation maps in the primary visual cortex. Journal of Neuroscience 33:15747-15766, 2013. http://dx.doi.org/10.1523/JNEUROSCI.1037-13.2013
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFn
Transfer function that applies a half-wave rectification (clips at zero)
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: imagen.transferfn.TransferFnWithState
Scatter values across time using a specified distribution, discretized into a symmetric interval around zero. This class is still work in progress as part of the TCAL model.
As no notion of time exists at the level of transfer functions (state is changes according to call count), this class assumes a fixed, ‘clocked’ timestep exists between subsequent calls.
Internally, an activity buffer is computed with a depth corresponding to the number of timestep intervals with the stated span value.
Note that the transfer function only has the power to delay output. Therefore the central peak of a unimodal, zero-mean distribution will occur after the time ‘span’ has elapsed.
In addition it is very important to view the depth map using the view_depth_map method: if the majority of the values generated by the distribution are outside the chosen span, values smaller and larger than the span will be lumped into the first and last bins respectively, distorting the shape of the intended distribution.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
Visualize the depth map using holoviews, including distribution histograms.
Mode may be one of ‘discrete’, ‘raw’ or ‘both’:
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.
Bases: imagen.transferfn.TransferFnWithState
Keeps track of attributes of a specified Parameterized over time, for analysis or plotting.
Useful objects to track include sheets (e.g. “topo.sim[‘V1’]”), projections (“topo.sim[‘V1’].projections[‘LateralInhibitory’]”), or an output_function.
Any attribute whose value is a matrix the same size as the activity matrix can be tracked. Only specified units within this matrix will be tracked.
If no object is specified, this function will keep track of the incoming activity over time.
The results are stored in a dictionary named ‘values’, as (time, value) pairs indexed by the parameter name and unit. For instance, if the value of attribute ‘x’ is v for unit (0.0,0.0) at time t, values[‘x’][(0.0,0.0)]=(t,v).
Updating of the tracked values can be disabled temporarily using the plastic parameter.
param Parameter norm_value (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Transfer functions may need additional information before the supplied numpy array can be modified in place. For instance, transfer functions may have state which needs to be allocated in memory with a certain size. In other cases, the transfer function may need to know about the coordinate system associated with the input data.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Temporarily disable plasticity of internal state.
This function should be implemented by all subclasses so that after a call, the output should always be the same for any given input pattern, and no call should have any effect that persists after restore_plasticity_state() is called.
By default, simply saves a copy of the ‘plastic’ parameter to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets the plastic parameter to the given value (True or False).
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Re-enable plasticity of internal state after an override_plasticity_state call.
This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to reenable changes to the internal state, without any lasting effect from the time during which plasticity was disabled.
By default, simply restores the last saved value of the ‘plastic’ parameter.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the state saved by the most recent state_push call.
Save the current state onto a stack, to be restored with state_pop.
Subclasses must implement state_push and state_pop to store state across invocations. The behaviour should be such that after state_pop, the state is restored to what it was at the time when state_push was called.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Output functions (see basic.py) and projection-level output functions (see projfn.py) written in C to optimize performance.
Requires the weave package; without it unoptimized versions are used.
Bases: topo.base.cf.CFPOutputFn
Performs divisive normalization of the weights of all cfs. Intended to be equivalent to, but faster than, CFPOF_DivisiveNormalizeL1.
param ClassSelector single_cf_fn (allow_None=False, constant=True, default=<DivisiveNormalizeL1 DivisiveNormalizeL101517>, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=True)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.base.cf.CFPOutputFn
Non-optimized version of CFPOF_DivisiveNormalizeL1_opt.
Same as CFPOF_Plugin(single_cf_fn=DivisiveNormalizeL1()), except that it supports joint normalization using the norm_total property of ConnectionField.
param ClassSelector single_cf_fn (allow_None=False, constant=True, default=<DivisiveNormalizeL1 DivisiveNormalizeL101518>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
alias of DivisiveNormalizeL1
Output functions (see basic.py) that apply to a whole Projection. For example, for a CFProjection this involves iterating through all the CFs and applying an output function to each set of weights in turn.
Bases: topo.base.cf.CFPOutputFn
Applies the specified single_cf_fn to each CF in the CFProjection for which the mask is nonzero.
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.
Bases: topo.base.cf.CFPOutputFn
CFPOutputFn that leaves the CFs unchanged.
Must never be changed or subclassed, because it might never be called. (I.e., it could simply be tested for and skipped.)
param ClassSelector single_cf_fn (allow_None=False, constant=True, default=<IdentityTF IdentityTF01278>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
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.
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
Print the default values of all cls’s Parameters.
Print the values of all this object’s Parameters.
Variant of __repr__ designed for generating a runnable script.
Set the default value of param_name.
Equivalent to setting param_name on the class.
Restore the most recently saved state.
See state_push() for more details.
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.
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
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.