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

Method record

bindsnet/network/monitors.py:100–117  ·  view source on GitHub ↗

Appends the current value of the recorded state variables to the recording.

(self)

Source from the content-addressed store, hash-verified

98 return return_logs
99
100 def record(self) -> None:
101 # language=rst
102 """
103 Appends the current value of the recorded state variables to the recording.
104 """
105 self.clean = False
106 for v in self.state_vars:
107 data = getattr(self.obj, v).unsqueeze(0)
108 # self.recording[v].append(data.detach().clone().to(self.device))
109 record = torch.empty_like(
110 data, device=self.device, requires_grad=False
111 ).copy_(data, non_blocking=True)
112 if self.sparse:
113 record = record.to_sparse()
114 self.recording[v].append(record)
115 # remove the oldest element (first in the list)
116 if self.time is not None:
117 self.recording[v].pop(0)
118
119 def reset_state_variables(self) -> None:
120 # language=rst

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected