Package topo :: Package base :: Module projection :: Class SheetMask
[hide private]
[frames] | no frames]

Class SheetMask

source code


An abstract class that defines a mask over a ProjectionSheet object.

This class is typically used for optimization, where mask indicates which neurons are active and should be processed further. A mask can also be used for lesion experiments, to specify which units should be kept inactive.

See the code for CFProjection and CFResponseFn to see how this class can be used to restrict the computation to only those neurons that the Mask lists as active.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
_get_data(self) source code
 
_set_data(self, data) source code
 
_get_sheet(self) source code
 
_set_sheet(self, sheet) source code
 
__init__(self, sheet=None, **params)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__and__(self, mask) source code
 
__or__(self, mask) source code
 
reset(self)
Initialize mask to default value (with no neurons masked out).
source code
 
calculate(self)
Calculate a new mask based on the activity of the sheet.
source code
 
update(self)
Update the current mask based on the current activity and a previous mask.
source code

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, script_repr, set_default, set_dynamic_time_fn, set_param, state_pop, state_push, verbose, warning

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]
  data = overridable_property(_get_data, _set_data, doc= ...
Ensure that whenever somebody accesses the data they are not None.
  sheet = overridable_property(_get_sheet, _set_sheet)
  name = <param.parameterized.String object at 0xa9c1e2c>
String identifier for this object.

Inherited from param.parameterized.Parameterized: print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sheet=None, **params)
(Constructor)

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

calculate(self)

source code 

Calculate a new mask based on the activity of the sheet.

For instance, in an algorithm like LISSOM that is based on a process of feedforward activation followed by lateral settling, the calculation is done at the beginning of each iteration after the feedforward activity has been calculated.

Subclasses should override this method to compute some non-default mask.

update(self)

source code 

Update the current mask based on the current activity and a previous mask.

Should be called only if calculate() has already been called since the last reset(); potentially faster to compute than redoing the entire calculate().

Subclasses should override this method to compute some non-default mask.


Class Variable Details [hide private]

data

Ensure that whenever somebody accesses the data they are not None.
Value:
overridable_property(_get_data, _set_data, doc= """
    Ensure that whenever somebody accesses the data they are not None.""")