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

Method set_batch_size

bindsnet/network/nodes.py:133–151  ·  view source on GitHub ↗

Sets mini-batch size. Called when layer is added to a network. :param batch_size: Mini-batch size.

(self, batch_size)

Source from the content-addressed store, hash-verified

131 ) # Spike trace decay (per timestep).
132
133 def set_batch_size(self, batch_size) -> None:
134 # language=rst
135 """
136 Sets mini-batch size. Called when layer is added to a network.
137
138 :param batch_size: Mini-batch size.
139 """
140 self.batch_size = batch_size
141 self.s = torch.zeros(
142 batch_size, *self.shape, device=self.s.device, dtype=torch.bool
143 )
144
145 if self.traces:
146 self.x = torch.zeros(batch_size, *self.shape, device=self.x.device)
147
148 if self.sum_input:
149 self.summed = torch.zeros(
150 batch_size, *self.shape, device=self.summed.device
151 )
152
153 def train(self, mode: bool = True) -> "Nodes":
154 # language=rst

Callers 12

add_layerMethod · 0.45
runMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45
set_batch_sizeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected