13.4. Connection

class Connection(source, target, toric=False)

Bases: object

A connection describes a flow of information between two groups (that can possibly be the same). It is characterized by a source group, a target group and a model describing both how to compute connection output, what state variable of the destination group holds the result and how connection evolves through time (if specified).

Left-hand side of the equation is the name of the state variable while right-hand side is the expression to be evaluated to get the actual output. Any state variable within the right-hand side of the equation refers to the source group if it exists.

Example:

>>> src = numpy.ones((3,3))
>>> tgt = numpy.ones((3,3), dtype=[('U',float),('V',float)])
>>> K = np.ones((src.size,))
>>> C = Connection(src, dst('U'), 'U = V*K')
>>> C.setup(), C.propagate()

In the above example, a connection has been created between src and tgt. The state variable holding the result in tgt is named U and the output of the connection is computed by mutliplying src by K.

propagate()

Propagate activity from source to target

output()

Return output of connection

evaluate(dt=0.01)

Update weights relative to connection equation

setup_weights(weights)

Setup weights if necessary

setup_equation(equation)

Setup weights update equation

source

Source of the connection.

target

Target of the connection.

weights

Weights matrix.

equation

Differential equation for weights update