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

Method forward

bindsnet/network/nodes.py:89–107  ·  view source on GitHub ↗

Abstract base class method for a single simulation step. :param x: Inputs to the layer.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

87
88 @abstractmethod
89 def forward(self, x: torch.Tensor) -> None:
90 # language=rst
91 """
92 Abstract base class method for a single simulation step.
93
94 :param x: Inputs to the layer.
95 """
96 if self.traces:
97 # Decay and set spike traces.
98 self.x *= self.trace_decay
99
100 if self.traces_additive:
101 self.x += self.trace_scale * self.s.float()
102 else:
103 self.x.masked_fill_(self.s.bool(), self.trace_scale)
104
105 if self.sum_input:
106 # Add current input to running sum.
107 self.summed += x.float()
108
109 def reset_state_variables(self) -> None:
110 # language=rst

Callers 12

runMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected