Package topo :: Package sheet :: Module basic :: Class JointNormalizingCFSheet
[hide private]
[frames] | no frames]

Class JointNormalizingCFSheet

source code

                        object --+                    
                                 |                    
 param.parameterized.Parameterized --+                
                                     |                
        base.simulation.EventProcessor --+            
                                         |            
                            object --+   |            
                                     |   |            
base.sheetcoords.SheetCoordinateSystem --+            
                                         |            
                          base.sheet.Sheet --+        
                                             |        
               base.projection.ProjectionSheet --+    
                                                 |    
                                   base.cf.CFSheet --+
                                                     |
                                                    JointNormalizingCFSheet
Known Subclasses:

A type of CFSheet extended to support joint sum-based normalization.

For L1 normalization, joint normalization means normalizing the sum of (the absolute values of) all weights in a set of corresponding CFs in different Projections, rather than only considering weights in the same CF.

This class makes it possible for a model to use joint normalization, by providing a mechanism for grouping Projections (see _port_match), plus a learn() function that computes the joint sums. Joint normalization also requires having ConnectionField store and return a norm_total for each neuron, and having an OutputFn that will respect this norm_total rather than the strict total of the ConnectionField's weights. At present, CFPOF_DivisiveNormalizeL1 and CFPOF_DivisiveNormalizeL1_opt do use norm_total; others can be extended to do something similar if necessary.

To enable joint normalization, you can declare that all the incoming connections that should be normalized together each have a dest_port of:

dest_port=('Activity','JointNormalize', 'AfferentGroup1'),

Then all those that have this dest_port will be normalized together, as long as an appropriate OutputFn is being used.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
start(self)
Called by the simulation when the EventProcessor is added to the simulation.
source code
 
_normalize_weights(self, mask=None)
Apply the weights_output_fn for every group of Projections.
source code
 
learn(self)
Call the learn() method on every Projection to the Sheet, and call the output functions (jointly if necessary).
source code

Inherited from base.cf.CFSheet: release_unit_view, update_unit_view

Inherited from base.projection.ProjectionSheet: __init__, activate, input_event, override_plasticity_state, present_input, process_current_time, projections, restore_plasticity_state

Inherited from base.sheet.Sheet: activity_len, release_sheet_view, row_col_sheetcoords, sheet_cols, sheet_offset, sheet_rows, state_pop, state_push

Inherited from base.sheet.Sheet (private): _get_density

Inherited from base.simulation.EventProcessor: script_repr, send_output

Inherited from base.simulation.EventProcessor (private): _src_connect

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, verbose, warning

Inherited from base.sheetcoords.SheetCoordinateSystem: closest_cell_center, matrix2sheet, matrixidx2sheet, sheet2matrix, sheet2matrixidx, sheetcoordinates_of_matrixidx

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]
  joint_norm_fn = param.Callable(default= compute_joint_norm_tot...
Function to use to compute the norm_total for each CF in each projection from a group to be normalized jointly.

Inherited from base.cf.CFSheet: measure_maps, precedence

Inherited from base.projection.ProjectionSheet: apply_output_fn, dest_ports, divisive_constant, mask, multiplicative_constant, output_fn, src_ports

Inherited from base.sheet.Sheet: layout_location, nominal_bounds, nominal_density, plastic

Inherited from param.parameterized.Parameterized: name, print_level

Properties [hide private]

Inherited from base.sheet.Sheet: density

Inherited from base.sheetcoords.SheetCoordinateSystem: shape, xdensity, ydensity

Inherited from object: __class__

Method Details [hide private]

start(self)

source code 

Called by the simulation when the EventProcessor is added to the simulation.

If an EventProcessor needs to have any code run when it is added to the simulation, the code can be put into this method in the subclass.

Overrides: base.simulation.EventProcessor.start
(inherited documentation)

_normalize_weights(self, mask=None)

source code 

Apply the weights_output_fn for every group of Projections.

The mask is telling which neurons need to be normalized.

learn(self)

source code 
Call the learn() method on every Projection to the Sheet, and call the output functions (jointly if necessary).
Overrides: base.projection.ProjectionSheet.learn

Class Variable Details [hide private]

joint_norm_fn

Function to use to compute the norm_total for each CF in each projection from a group to be normalized jointly.
Value:
param.Callable(default= compute_joint_norm_totals, doc= """
    Function to use to compute the norm_total for each CF in each
    projection from a group to be normalized jointly.""")