MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / add_connection

Method add_connection

bindsnet/network/network.py:134–149  ·  view source on GitHub ↗

Adds a connection between layers of nodes to the network. :param connection: An instance of class ``Connection``. :param source: Logical name of the connection's source layer. :param target: Logical name of the connection's target layer.

(
        self, connection: AbstractConnection, source: str, target: str
    )

Source from the content-addressed store, hash-verified

132 layer.set_batch_size(self.batch_size)
133
134 def add_connection(
135 self, connection: AbstractConnection, source: str, target: str
136 ) -> None:
137 # language=rst
138 """
139 Adds a connection between layers of nodes to the network.
140
141 :param connection: An instance of class ``Connection``.
142 :param source: Logical name of the connection's source layer.
143 :param target: Logical name of the connection's target layer.
144 """
145 self.connections[(source, target)] = connection
146 self.add_module(source + "_to_" + target, connection)
147
148 connection.dt = self.dt
149 connection.train(self.learning)
150
151 def add_monitor(self, monitor: AbstractMonitor, name: str) -> None:
152 # language=rst

Callers 15

test_add_objectsMethod · 0.95
test_hebbianMethod · 0.95
test_post_preMethod · 0.95
test_mstdpMethod · 0.95
test_mstdpetMethod · 0.95
test_rmaxMethod · 0.95
test_weightsMethod · 0.95
BindsNET_cpuFunction · 0.95
BindsNET_gpuFunction · 0.95
mainFunction · 0.95

Calls 1

trainMethod · 0.45

Tested by 9

test_add_objectsMethod · 0.76
test_hebbianMethod · 0.76
test_post_preMethod · 0.76
test_mstdpMethod · 0.76
test_mstdpetMethod · 0.76
test_rmaxMethod · 0.76
test_weightsMethod · 0.76