Package topo :: Package projection :: Module basic :: Class ScaledCFProjection
[hide private]
[frames] | no frames]

Class ScaledCFProjection

source code

                       object --+                
                                |                
param.parameterized.Parameterized --+            
                                    |            
         base.simulation.EPConnection --+        
                                        |        
               base.projection.Projection --+    
                                            |    
                         base.cf.CFProjection --+
                                                |
                                               ScaledCFProjection

Allows scaling of activity based on a specified target average activity.

An exponentially weighted average is used to calculate the average activity. This average is then used to calculate scaling factors for the current activity and for the learning rate.

The plastic parameter can be used to turn off updating of the average activity, e.g. during map measurement.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
calculate_sf(self)
Calculate current scaling factors based on the target and previous average activities.
source code
 
do_scaling(self)
Scale the projection activity and learning rate for the projection.
source code
 
activate(self, input_activity)
Activate using the specified response_fn and output_fn.
source code

Inherited from base.cf.CFProjection: apply_learn_output_fn, cf, change_bounds, change_density, create_mask, get_view, learn, n_units

Inherited from base.cf.CFProjection (private): _cleanup

Inherited from base.projection.Projection: get_projection_view, override_plasticity_state, restore_plasticity_state

Inherited from base.simulation.EPConnection: remove, script_repr

Inherited from param.parameterized.Parameterized: __getstate__, __repr__, __setstate__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, set_dynamic_time_fn, state_pop, state_push, verbose, warning

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

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  target = param.Number(default= 0.045, doc= """Target average a...
Target average activity for the projection.
  target_lr = param.Number(default= 0.045, doc= ...
Target average activity for scaling the learning rate.
  smoothing = param.Number(default= 0.999, doc= ...
Influence of previous activity, relative to current, for computing the average.
  precedence = param.Number(default= 0.4)

Inherited from base.cf.CFProjection: allow_null_cfs, apply_output_fn_init, autosize_mask, cf_shape, cf_type, coord_mapper, learning_fn, learning_rate, nominal_bounds_template, response_fn, same_cf_shape_for_all_cfs, strength, weights_generator, weights_output_fn

Inherited from base.projection.Projection: activity_group, dest_port, output_fn, plastic, src_port

Inherited from base.simulation.EPConnection: delay, dest, private, src

Inherited from param.parameterized.Parameterized: name, print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

calculate_sf(self)

source code 

Calculate current scaling factors based on the target and previous average activities.

Keeps track of the scaled average for debugging. Could be overridden by a subclass to calculate the factors differently.

activate(self, input_activity)

source code 
Activate using the specified response_fn and output_fn.
Overrides: base.projection.Projection.activate

Class Variable Details [hide private]

target

Target average activity for the projection.
Value:
param.Number(default= 0.045, doc= """Target average activity for the projection.""\
")

target_lr

Target average activity for scaling the learning rate.
Value:
param.Number(default= 0.045, doc= """
        Target average activity for scaling the learning rate.""")

smoothing

Influence of previous activity, relative to current, for computing the average.
Value:
param.Number(default= 0.999, doc= """
        Influence of previous activity, relative to current, for computing the ave\
rage.""")