topo.gpu Package


projection Module

Inheritance diagram of topo.gpu.projection

topo.gpu.projection.CFPLF_Hebbian_Sparse_GPU(projection)[source]

Sparse CF Projection learning function applying Hebbian learning to the weights in a projection.

topo.gpu.projection.CFPOF_DivisiveNormalizeL1_Sparse_GPU(projection)[source]

Divisive normalisation computed on the GPU

topo.gpu.projection.CFPRF_DotProduct_Sparse_GPU(projection)[source]

Sparse CF Projection response function calculating the dot-product between incoming activities and CF weights. Uses GPU.

class topo.gpu.projection.GPUSparseCFProjection(**params)[source]

Bases: topo.sparse.sparsecf.SparseCFProjection

A projection composed of SparseConnectionFields from a Sheet into a ProjectionSheet, calculated using a GPU.

Any subclass has to implement the interface activate(self) that computes the response from the input and stores it in the activity array.

param Number precedence (allow_None=False, bounds=None, constant=False, default=0.8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)

param Boolean private (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Set to true if this connection is for internal use only, not to be manipulated by a user.
param Integer seed (allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
The random seed used to determine the randomized weight initialization stream. If not None, equivalent to appending the chosen integer to the hash_format.

param Boolean initialized (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)

param Boolean apply_output_fns_init (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to apply the output function to connection fields (e.g. for normalization) when the CFs are first created.
param Parameter dest_port (allow_None=False, constant=False, default=Activity, instantiate=False, pickle_default_value=True, precedence=0.21, readonly=False)
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 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.
param Number strength (allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Global multiplicative scaling applied to the Activity of this Sheet.
param Parameter src_port (allow_None=False, constant=False, default=Activity, instantiate=False, pickle_default_value=True, precedence=0.2, readonly=False)
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.
param Parameter cf_type (allow_None=False, constant=False, default=<class ‘topo.sparse.sparsecf.SparseConnectionField’>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Type of ConnectionField to use when creating individual CFs.
param ClassSelector cf_shape (allow_None=False, constant=True, default=<Constant Constant01282>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Mask pattern to define the shape of the connection fields.
param Boolean plastic (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to update the internal state on each call. Allows plasticity to be turned off during analysis, and then re-enabled.
param Number delay (allow_None=False, bounds=(0, None), constant=False, default=0.05, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Simulation time between generation of an Event by the src and delivery to the dest. Should normally be nonzero, to represent a causal with a well-defined ordering of events.
param BoundingRegionParameter nominal_bounds_template (allow_None=False, constant=False, default=BoundingBox(radius=0.1), instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Bounds defining the Sheet area covered by a prototypical ConnectionField. The true bounds will differ depending on the density (see create_slice_template()).
param Callable response_fn (allow_None=False, constant=False, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Function for computing the Projection response to an input pattern.
param Boolean same_cf_shape_for_all_cfs (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not to share a single cf_shape mask for all CFs. If True, the cf_shape is evaluated only once and shared for all CFs, which saves computation time and memory. If False, the cf_shape is evaluated once for each CF, allowing each to have its own shape.
param Parameter activity_group (allow_None=False, constant=False, default=(0.5, <ufunc ‘add’>), instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
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.
param ClassSelector coord_mapper (allow_None=False, constant=False, default=<IdentityMF IdentityMF01287>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Function to map a projected coordinate into the target sheet.
param Number mask_threshold (allow_None=False, bounds=None, constant=True, default=0.5, inclusive_bounds=(True, True), instantiate=True, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
If a unit is above this value in the cf_shape mask, it is included; otherwise it is excluded from the mask.
param Parameter dest (allow_None=True, constant=True, default=None, instantiate=True, pickle_default_value=True, precedence=0.11, readonly=False)
The EventProcessor to which messages are delivered.
param Number learning_rate (allow_None=False, bounds=None, constant=False, default=0.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Amount of learning at each step for this projection, specified in units that are independent of the density of each Sheet.
param Boolean autosize_mask (allow_None=False, bounds=(0, 1), constant=True, default=True, instantiate=True, pickle_default_value=True, precedence=-1, readonly=False)
Topographica sets the mask size so that it is the same as the connection field’s size, unless this parameter is False - in which case the user-specified size of the cf_shape is used. In normal usage of Topographica, this parameter should remain True.
param Boolean allow_null_cfs (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether or not the projection can have entirely empty CFs
param Integer min_matrix_radius (allow_None=False, bounds=(0, None), constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Enforced minimum for radius of weights matrix. The default of 1 gives a minimum matrix of 3x3. 0 would allow a 1x1 matrix.
param Callable learning_fn (allow_None=False, constant=False, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Function for computing changes to the weights based on one activation step.
param String hash_format (allow_None=False, basestring=<type ‘basestring’>, constant=False, default={name}-{src}-{dest}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Format string to determine the hash value used to initialize random weight generation. Format keys available include {name} {src} and {dest}.
param Parameter src (allow_None=True, constant=True, default=None, instantiate=True, pickle_default_value=True, precedence=0.1, readonly=False)
The EventProcessor from which messages originate.
param ClassSelector weights_generator (allow_None=False, constant=True, default=<Constant Constant01281>, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
Generate initial weights values.
param HookList weights_output_fns (allow_None=False, bounds=(0, None), constant=False, default=[<function CFPOF_DivisiveNormalizeL1_Sparse_GPU at 0x2b07ab243320>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Functions applied to each CF after learning.
param HookList input_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Function(s) applied to the input before the projection activity is computed.
param HookList output_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Function(s) applied to the projection activity after it is computed.
activate(input_activity)

Activate using the specified response_fn and output_fn.

apply_learn_output_fns(active_units_mask=True)

Apply the weights_output_fns to each unit.

cf(r, c)

Return the specified ConnectionField

cf_bounds(r, c)

Return the bounds of the specified ConnectionField.

cf_type

alias of SparseConnectionField

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07aa75bec0>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07aa75bfc8>
inspect_value = <functools.partial object at 0x2b07aa1f3050>
learn()

For a SparseCFProjection, learn consists of calling the learning_fn.

static learning_fn(projection)

Sparse CF Projection learning function applying Hebbian learning to the weights in a projection.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

n_bytes()

Estimates the size on the basis of the number non-zeros in the sparse matrix, asssuming indices and values are stored using 32-bit integers and floats respectively.

n_conns()

Returns number of nonzero weights.

override_plasticity_state(new_plasticity_state)

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.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

projection_view(timestamp=None)

Returns the activity in a single projection

remove()

Remove this connection from its src’s list of out_connections and its dest’s list of in_connections.

static response_fn(projection)

Sparse CF Projection response function calculating the dot-product between incoming activities and CF weights. Uses GPU.

restore_plasticity_state()

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.

script_repr(imports=, []prefix=' ')

Generate a runnable command for creating this connection.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07aa1f3730>
set_param = <functools.partial object at 0x2b07aa1f3788>
state_pop()

Pop the most recently pushed activity state of the stack.

state_push()

Push the current activity state onto the stack.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

view(sheet_x, sheet_y, timestamp=None, situated=False, **kwargs)

Return a single connection field Image, for the unit located nearest to sheet coordinate (sheet_x,sheet_y).

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.


sheet Module

Inheritance diagram of topo.gpu.sheet

class topo.gpu.sheet.GPUSettlingCFSheet(**params)[source]

Bases: topo.sheet.SettlingCFSheet

A SettlingCFSheet that makes it possible to calculate projection activities and learning in concurrent GPU streams. This is done by placing barriers before the ‘activate’ and ‘learn’ methods of the sheet that synchronize GPU streams.

Otherwise, behaves exactly the same as SettlingCFSheet.

param Boolean apply_output_fns (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to apply the output_fn after computing an Activity matrix.
param Boolean continuous_learning (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to modify the weights after every settling step. If false, waits until settling is completed before doing learning.
param Number precedence (allow_None=False, bounds=None, constant=False, default=0.6, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Allows a sorting order for Sheets, e.g. in the GUI.
param Integer mask_init_time (allow_None=False, bounds=(0, None), constant=False, default=5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Determines when a new mask is initialized in each new iteration. The mask is reset whenever new input comes in. Once the activation_count (see tsettle) reaches mask_init_time, the mask is initialized to reflect the current activity profile.
param BoundingRegionParameter nominal_bounds (allow_None=False, constant=True, default=BoundingBox(radius=0.5), instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
User-specified BoundingBox of the Sheet coordinate area covered by this Sheet. The left and right bounds–if specified–will always be observed, but the top and bottom bounds may be adjusted to ensure the density in the y direction is the same as the density in the x direction. In such a case, the top and bottom bounds are adjusted so that the center y point remains the same, and each bound is as close as possible to its specified value. The actual value of this Parameter is not adjusted, but the true bounds may be found from the ‘bounds’ attribute of this object.
param Parameter mask (allow_None=False, constant=False, default=<SheetMask SheetMask00984>, instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
SheetMask object for computing which units need to be computed further. The object should be an instance of SheetMask, and will compute which neurons will be considered active for the purposes of further processing. The default mask effectively disables all masking, but subclasses can use this mask to implement optimizations, non-rectangular Sheet shapes, lesions, etc.
param Number row_precedence (allow_None=False, bounds=None, constant=False, default=0.5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Allows grouping of Sheets before sorting precedence is applied, e.g. for two-dimensional plots in the GUI.
param Boolean plastic (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Setting this to False tells the Sheet not to change its permanent state (e.g. any connection weights) based on incoming events.
param Boolean measure_maps (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Whether to include this Sheet when measuring various maps to create SheetViews.
param Number nominal_density (allow_None=False, bounds=None, constant=True, default=10, inclusive_bounds=(True, True), instantiate=True, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
User-specified number of processing units per 1.0 distance horizontally or vertically in Sheet coordinates. The actual number may be different because of discretization; the matrix needs to tile the plane exactly, and for that to work the density might need to be adjusted. For instance, an area of 3x2 cannot have a density of 2 in each direction. The true density may be obtained from either the xdensity or ydensity attribute (since these are identical for a Sheet).
param HookList output_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
Output function(s) to apply (if apply_output_fns is true) to this Sheet’s activity.
param HookList beginning_of_iteration (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callables to be executed at the beginning of each iteration.
param Integer tsettle (allow_None=False, bounds=(0, None), constant=False, default=8, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Number of times to activate the SettlingCFSheet sheet for each external input event. A counter is incremented each time an input is received from any source, and once the counter reaches tsettle, the last activation step is skipped so that there will not be any further recurrent activation. The next external (i.e., afferent or feedback) event will then start the counter over again.
param Boolean allow_skip_non_responding_units (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
If true, then units that are inactive after the response function has been called can be skipped in subsequent processing. Whether or not the units will actually be skipped depends on the implementation of learning and learning output functions.
param HookList post_initialization_weights_output_fns (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False)
If not empty, weights output_fns that will replace the existing ones after an initial normalization step.
param HookList end_of_iteration (allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
List of callables to be executed at the end of each iteration.
param NumericTuple layout_location (allow_None=False, constant=False, default=(-1, -1), instantiate=False, length=2, pickle_default_value=True, precedence=-1, readonly=False)
Location for this Sheet in an arbitrary pixel-based space in which Sheets can be laid out for visualization.
param Callable joint_norm_fn (allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
Function to use to compute the norm_total for each CF in each gpu projection from a group to be normalized jointly.
param Dict properties (allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False)
A dictionary of property values associated with the Sheet object. For instance, the dictionary: {‘polarity’:’ON’, ‘eye’:’Left’} could be used to indicate a left, LGN Sheet with ON-surround receptive fields.
param Parameter strict_tsettle (allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
If non-None, delay sending output until activation_count reaches this value.
activate()

Collect activity from each projection, combine it to calculate the activity for this sheet, and send the result out.

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

activity_len()

Return the number of items that have been saved by state_push().

closest_cell_center(x, y)

Given arbitary sheet coordinates, return the sheet coordinates of the center of the closest unit.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

density

The sheet’s true density (i.e. the xdensity, which is equal to the ydensity for a Sheet.)

force_new_dynamic_value = <functools.partial object at 0x2b07ab6bb8e8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07ab6bb680>
inspect_value = <functools.partial object at 0x2b07ab6bb998>
learn()

Call the learn() method on every Projection to the Sheet, and call the output functions (jointly if necessary).

matrix2sheet(float_row, float_col)

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet(row, col)

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

n_bytes()

Estimate the memory bytes taken by this Sheet and its Projections.

Typically, this number will include the activity array and any similar arrays, plus memory taken by all incoming Projections. It will not usually include memory taken by the Python dictionary or various “housekeeping” attributes, which usually contribute only a small amount to the memory requirements. Thus this value should be considered only a rough lower bound from which memory requirements and memory usage patterns can be estimated.

Subclasses should reimplement this method if they store a significant amount of data other than in the activity array and the projections.

n_conns()

Count the total size of all incoming projections, in number of connections.

override_plasticity_state(new_plasticity_state)

Temporarily override plasticity state of medium and long term internal state.

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

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, calls override_plasticity_state() on the ProjectionSheet’s output_fns and all of its incoming Projections, and also enables the ‘plastic’ parameter for this ProjectionSheet. The old value of the plastic parameter is saved to an internal stack to be restored by restore_plasticity_state().

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

present_input(input_activity, conn)

Provide the given input_activity to each in_projection that has a dest_port equal to the specified port, asking each one to compute its activity.

The sheet’s own activity is not calculated until activate() is called.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

process_current_time()[source]

Pass the accumulated stimulation through self.output_fns and send it out on the default output port.

We need to synchronize before processing the projection activities or their weights, since they might be still running on the GPU.

projections(name=None)

Return either a named input p, or a dictionary {projection_name, projection} of all the in_connections for this ProjectionSheet.

A minor convenience function for finding projections by name; the sheet’s list of in_connections usually provides simpler access to the Projections.

release_sheet_view(view_name)

Delete the dictionary entry with key entry ‘view_name’ to save memory.

row_col_sheetcoords()

Return an array of Y-coordinates corresponding to the rows of the activity matrix of the sheet, and an array of X-coordinates corresponding to the columns.

script_repr(imports=, []prefix=' ')

Generate a runnable command for creating this EventProcessor.

send_output(src_port=None, data=None)

Send some data out to all connections on the given src_port.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07ab6bbb50>
set_param = <functools.partial object at 0x2b07ab6bbba8>
sheet2matrix(x, y)

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx(x, y)

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx()

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sheetcoords_of_idx_grid()

Return an array of x-coordinates and an array of y-coordinates corresponding to the activity matrix of the sheet.

update_unit_view(x, y, proj_name='')

Creates the list of UnitView objects for a particular unit in this CFSheet. (There is one UnitView for each Projection to this CFSheet).

Each UnitView is then added to the sheet_views of its source sheet. It returns the list of all UnitViews for the given unit.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.