Package topo :: Package outputfns :: Module basic :: Class OutputFnWithState
[hide private]
[frames] | no frames]

Class OutputFnWithState

source code

                                  object --+        
                                           |        
base.parameterizedobject.ParameterizedObject --+    
                                               |    
                  base.functionfamilies.OutputFn --+
                                                   |
                                                  OutputFnWithState
Known Subclasses:
ActivityAveragingOF, AttributeTrackingOF, HomeostaticMaxEnt, ScalingOF

Abstract base class for OutputFns that need to maintain a self.plastic parameter.

These OutputFns typically maintain some form of internal history or other state from previous calls, which can be disabled by override_plasticity_state().



Nested Classes [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
Initialize this ParameterizedObject.
source code
 
override_plasticity_state(self, new_plasticity_state)
Temporarily disable plasticity of internal state.
source code
 
restore_plasticity_state(self)
Re-enable plasticity of internal state after an override_plasticity_state call.
source code

Inherited from base.functionfamilies.OutputFn: __add__, __call__

Inherited from base.parameterizedobject.ParameterizedObject: __getstate__, __repr__, __setstate__, __str__, as_uninitialized, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, verbose, warning

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: params, print_param_defaults

Class Variables [hide private]
  plastic = <topo.base.parameterclasses.BooleanParameter object ...
Whether or not to update the internal state on each call.
  __abstract = True
bool(x) -> bool

Inherited from base.functionfamilies.OutputFn: norm_value

Inherited from base.parameterizedobject.ParameterizedObject: name, print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 

Initialize this ParameterizedObject.

The values of parameters can be supplied as keyword arguments to the constructor (using parametername=parametervalue); these values will override the class default values for this one instance.

If no 'name' parameter is supplied, self.name defaults to the object's class name with a unique number appended to it.

Overrides: base.parameterizedobject.ParameterizedObject.__init__
(inherited documentation)

override_plasticity_state(self, new_plasticity_state)

source code 

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 (apart from true randomness or other differences that do not depend on an internal state), and no call should have any effect that persists after a subsequent restore_plasticity_state() call.

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).

restore_plasticity_state(self)

source code 

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.


Class Variable Details [hide private]

plastic

Whether or not to update the internal state on each call. Allows plasticity to be turned off during analysis, and then re-enabled.
Value:
BooleanParameter(default= True, doc= """
        Whether or not to update the internal state on each call.
        Allows plasticity to be turned off during analysis, and then re-enabled.""\
")

__abstract

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
True