Package topo :: Package sheet :: Module lissom :: Class JointScaling
[hide private]
[frames] | no frames]

Class JointScaling

source code


LISSOM sheet extended to allow joint auto-scaling of Afferent input projections.

An exponentially weighted average is used to calculate the average joint activity across all jointly-normalized afferent projections. This average is then used to calculate a scaling factor for the current afferent activity and for the afferent learning rate.

The target average activity for the afferent projections depends on the statistics of the input; if units are activated more often (e.g. the number of Gaussian patterns on the retina during each iteration is increased) the target average activity should be larger in order to maintain a constant average response to similar inputs in V1. The target activity for learning rate scaling does not need to change, because the learning rate should be scaled regardless of what causes the change in average activity.

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_joint_sf(self, joint_total)
Calculate current scaling factors based on the target and previous average joint activities.
source code
 
do_joint_scaling(self)
Scale jointly normalized projections together.
source code
 
activate(self)
Compute appropriate scaling factors, apply them, and collect resulting activity.
source code
 
state_push(self, **args)
Save this instance's state.
source code
 
state_pop(self, **args)
Restore the most recently saved state.
source code

Inherited from LISSOM: input_event, printwts, process_current_time, send_output, start

Inherited from basic.JointNormalizingCFSheet: learn

Inherited from base.cf.CFSheet: release_unit_view, update_unit_view

Inherited from base.projection.ProjectionSheet: n_bytes, n_conns, override_plasticity_state, present_input, projections, restore_plasticity_state

Inherited from base.sheet.Sheet: activity_len, release_sheet_view, row_col_sheetcoords, sheet_cols, sheet_rows, sheetcoords_of_idx_grid

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

Inherited from base.simulation.EventProcessor: script_repr

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_default, set_dynamic_time_fn, set_param, verbose, warning

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

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

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 activity for jointly scaled projections.
  target_lr = param.Number(default= 0.045, doc= ...
Target average activity for jointly scaled projections.
  smoothing = param.Number(default= 0.999, doc= ...
Influence of previous activity, relative to current, for computing the average.
  apply_scaling = param.Boolean(default= True, doc= """Whether t...
Whether to apply the scaling factors.
  precedence = param.Number(0.65)
Allows a sorting order for Sheets, e.g.
  name = <param.parameterized.String object at 0xb46372c>
String identifier for this object.

Inherited from LISSOM: beginning_of_iteration, continuous_learning, end_of_iteration, mask_init_time, output_fns, post_initialization_weights_output_fns, strict_tsettle, tsettle

Inherited from basic.JointNormalizingCFSheet: joint_norm_fn

Inherited from base.cf.CFSheet: measure_maps

Inherited from base.projection.ProjectionSheet: allow_skip_non_responding_units, dest_ports, mask, src_ports

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

Inherited from param.parameterized.Parameterized: 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]

__init__(self, **params)
(Constructor)

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

calculate_joint_sf(self, joint_total)

source code 

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

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

do_joint_scaling(self)

source code 

Scale jointly normalized projections together.

Assumes that the projections to be jointly scaled are those that are being jointly normalized. Calculates the joint total of the grouped projections, and uses this to calculate the scaling factor.

activate(self)

source code 

Compute appropriate scaling factors, apply them, and collect resulting activity.

Scaling factors are first computed for each set of jointly normalized projections, and the resulting activity patterns are then scaled. Then the activity is collected from each projection, combined to calculate the activity for this sheet, and the result is sent out.

Overrides: base.sheet.Sheet.activate

state_push(self, **args)

source code 

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.

Overrides: param.parameterized.Parameterized.state_push
(inherited documentation)

state_pop(self, **args)

source code 

Restore the most recently saved state.

See state_push() for more details.

Overrides: param.parameterized.Parameterized.state_pop
(inherited documentation)

Class Variable Details [hide private]

target

Target average activity for jointly scaled projections.
Value:
param.Number(default= 0.045, doc= """
        Target average activity for jointly scaled projections.""")

target_lr

Target average activity for jointly scaled projections.

Used for calculating a learning rate scaling factor.

Value:
param.Number(default= 0.045, doc= """
        Target average activity for jointly scaled projections.

        Used for calculating a learning rate scaling factor.""")

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

apply_scaling

Whether to apply the scaling factors.
Value:
param.Boolean(default= True, doc= """Whether to apply the scaling factors.""")

precedence

Allows a sorting order for Sheets, e.g. in the GUI.
Value:
param.Number(0.65)