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

Class Projection

source code

                       object --+        
                                |        
param.parameterized.Parameterized --+    
                                    |    
              simulation.EPConnection --+
                                        |
                                       Projection
Known Subclasses:

A projection from a Sheet into a ProjectionSheet.

Projections are required to support the activate() method, which will construct a matrix the same size as the target ProjectionSheet, from an input matrix of activity from the source Sheet. Other than that, a Projection may be of any type.

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
 
activate(self, input_activity)
Compute an activity matrix for output, based on the specified input_activity.
source code
 
apply_learn_output_fn(self, mask)
Sub-classes can implement this function if they wish to perform an operation after learning has completed, such as normalizing weight values across different projections.
source code
 
get_projection_view(self, timestamp)
Returns the activity in a single projection
source code
 
learn(self)
This function has to be re-implemented by sub-classes, if they wish to support learning.
source code
 
override_plasticity_state(self, new_plasticity_state)
Temporarily override plasticity of medium and long term internal state.
source code
 
restore_plasticity_state(self)
Restore previous plasticity state of medium and long term internal state after a override_plasticity_state call.
source code

Inherited from 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]
  __abstract = True
bool(x) -> bool
  activity_group = param.Parameter(default= (0.5, numpy.add), do...
Grouping and precedence specifier for computing activity from Projections.
  dest_port = param.Parameter(default= 'Activity')
Identifier that can be used to distinguish different types of incoming connections.
  output_fn = param.ClassSelector(OutputFn, default= IdentityOF(...
Function applied to the Projection activity after it is computed.
  plastic = param.Boolean(default= True, doc= ...
Whether or not to update the internal state on each call.
  precedence = param.Number(default= 0.5)
  src_port = param.Parameter(default= 'Activity')
Identifier that can be used to distinguish different types of outgoing connections.
  strength = param.Number(default= 1.0)

Inherited from 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)

activate(self, input_activity)

source code 

Compute an activity matrix for output, based on the specified input_activity.

Subclasses must override this method to whatever it means to calculate activity in that subclass.

apply_learn_output_fn(self, mask)

source code 

Sub-classes can implement this function if they wish to perform an operation after learning has completed, such as normalizing weight values across different projections.

The mask argument determines which units should have their output_fn applied; units that are nonzero in the mask must have the function applied, while those that are zero may or may not have the function applied (depending on various optimizations).

override_plasticity_state(self, new_plasticity_state)

source code 

Temporarily override plasticity of medium and long term internal state.

This function should be implemented by all subclasses so that it preserves the ability of the Projection to compute activity, i.e. to operate over a short time scale, while preventing any lasting changes to the state.

For instance, if new_plasticity_state is False, in a Projection with modifiable connection weights, the values of those weights should temporarily be made fixed and unchanging after this call. For a Projection with automatic normalization, homeostatic plasticity, or other features that depend on a history of events (rather than just the current item being processed), changes in those properties would be disabled temporarily. Setting the plasticity state to False is useful during analysis operations (e.g. map measurement) that would otherwise change the state of the underlying network.

Any process that does not have any lasting state, such as those affecting only the current activity level, should not be affected by this call.

By default, this call simply calls override_plasticity_state() on the Projection's output_fn, and sets the 'plastic' parameter to False.

restore_plasticity_state(self)

source code 

Restore previous plasticity state of medium and long term internal state after a override_plasticity_state call.

This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, e.g. to reenable plasticity of any type that was disabled.


Class Variable Details [hide private]

__abstract

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
True

activity_group

Grouping and precedence specifier for computing activity from Projections. In a ProjectionSheet, all Projections in the same activity_group will be summed, and then the results from each group will be combined in the order of the activity_group using the operator specified by the activity_operator. For instance, if there are two Projections with activity_group==(0.2,numpy.add) and two with activity_group==(0.6,numpy.divide), activity from the first two will be added together, and the result divided by the sum of the second two.
Value:
param.Parameter(default= (0.5, numpy.add), doc= """
       Grouping and precedence specifier for computing activity from
       Projections.  In a ProjectionSheet, all Projections in the
       same activity_group will be summed, and then the results from
       each group will be combined in the order of the activity_group
       using the operator specified by the activity_operator.  For
       instance, if there are two Projections with
       activity_group==(0.2,numpy.add) and two with
...

dest_port

Identifier that can be used to distinguish different types of incoming connections.

EventProcessors that accept only a single type of incoming event will typically use a src_port of None. However, if multiple types are of communication are meaningful, the EventProcessor can accept other values for dest_port. It is up to the dest EventProcessor to process the data appropriately for each port, and to define what is expected to be sent to that port.

Value:
param.Parameter(default= 'Activity')

output_fn

Function applied to the Projection activity after it is computed.
Value:
param.ClassSelector(OutputFn, default= IdentityOF(), doc= """
    Function applied to the Projection activity after it is computed.""")

plastic

Whether or not to update the internal state on each call. Allows plasticity to be turned off during analysis, and then re-enabled.
Value:
param.Boolean(default= True, doc= """
        Whether or not to update the internal state on each call.
        Allows plasticity to be turned off during analysis, and then re-enabled.""\
")

src_port

Identifier that can be used to distinguish different types of outgoing connections.

EventProcessors that generate only a single type of outgoing event will typically use a src_port of None. However, if multiple types of communication are meaningful, the EventProcessor can accept other values for src_port. It is up to the src EventProcessor to deliver appropriate data to each port, and to declare what will be sent over that port.

Value:
param.Parameter(default= 'Activity')