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

Class ScalingOF

source code

                                  object --+            
                                           |            
base.parameterizedobject.ParameterizedObject --+        
                                               |        
                  base.functionfamilies.OutputFn --+    
                                                   |    
                                   OutputFnWithState --+
                                                       |
                                                      ScalingOF

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.



Nested Classes [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
Initialize this ParameterizedObject.
source code
 
__call__(self, x) source code

Inherited from OutputFnWithState: override_plasticity_state, restore_plasticity_state

Inherited from base.functionfamilies.OutputFn: __add__

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]
  target = Number(default= 0.01, doc= ...
Target average activity for each unit.
  step = Number(default= 1, doc= ...
How often to calculate the average activity and scaling factor.
  smoothing = <topo.base.parameterclasses.Number object at 0x9db...
Determines the degree of weighting of previous activity vs.

Inherited from OutputFnWithState: plastic

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: OutputFnWithState.__init__

__call__(self, x)
(Call operator)

source code 
Overrides: base.functionfamilies.OutputFn.__call__

Class Variable Details [hide private]

target

Target average activity for each unit.
Value:
Number(default= 0.01, doc= """
        Target average activity for each unit.""")

step

How often to calculate the average activity and scaling factor.
Value:
Number(default= 1, doc= """
        How often to calculate the average activity and scaling factor.""")

smoothing

Determines the degree of weighting of previous activity vs. current activity when calculating the average.
Value:
Number(default= 0.9997, doc= """
        Determines the degree of weighting of previous activity vs.
        current activity when calculating the average.""")