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

Method add_layer

bindsnet/network/network.py:119–132  ·  view source on GitHub ↗

Adds a layer of nodes to the network. :param layer: A subclass of the ``Nodes`` object. :param name: Logical name of layer.

(self, layer: Nodes, name: str)

Source from the content-addressed store, hash-verified

117 self.reward_fn = None
118
119 def add_layer(self, layer: Nodes, name: str) -> None:
120 # language=rst
121 """
122 Adds a layer of nodes to the network.
123
124 :param layer: A subclass of the ``Nodes`` object.
125 :param name: Logical name of layer.
126 """
127 self.layers[name] = layer
128 self.add_module(name, layer)
129
130 layer.train(self.learning)
131 layer.compute_decays(self.dt)
132 layer.set_batch_size(self.batch_size)
133
134 def add_connection(
135 self, connection: AbstractConnection, source: str, target: str

Callers 15

test_add_objectsMethod · 0.95
test_initMethod · 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

Calls 3

trainMethod · 0.45
compute_decaysMethod · 0.45
set_batch_sizeMethod · 0.45

Tested by 10

test_add_objectsMethod · 0.76
test_initMethod · 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