Node Operations#

This module provides basic operations for constructing node graphs.

It supports the following operations:

  1. feedforward connection: “>>”, “>>=”

  2. feedback connection: “<<”, “<<=”

  3. merge two nodes: “&”, “&=”

  4. select subsets of one node: “[:]”

  5. concatenate a sequence of nodes: “[node1, node2, …]”, “(node1, node2, …)”

  6. wrap a set of nodes: “{node1, node2, …}”

However, all operations should satisfy the following assumptions:

  1. Feedback connection of (node1, node2) should have a feedforward path from node2 to node1.

  2. Feedforward or feedback connections cannot generate a cycle.

  3. Cannot concatenate multiple receiver nodes, e.g., a >> [b, c] is forbidden, but a >> {b, c} is allowed.

ff_connect(senders, receivers[, inplace, ...])

Connect two sequences of Node instances to form a brainpy.nn.base.Network instance.

fb_connect(senders, receivers[, inplace, ...])

Create a feedback connection from sender node to receiver node.

merge(node, *other_nodes[, inplace, name, ...])

Merge different Node or brainpy.nn.base.Network instances into a single brainpy.nn.base.Network instance.

select(node, index[, name])

concatenate(nodes[, axis, name])