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

Method elig_at_second_spike

test/network/test_mstdp_florian.py:173–184  ·  view source on GitHub ↗
(pre_first)

Source from the content-addressed store, hash-verified

171 T, dt, tc = 10, 1.0, 20.0
172
173 def elig_at_second_spike(pre_first):
174 pre = torch.zeros(T, 1, 1)
175 post = torch.zeros(T, 1, 1)
176 if pre_first:
177 pre[2, 0, 0] = 1.0
178 post[5, 0, 0] = 1.0
179 else:
180 post[2, 0, 0] = 1.0
181 pre[5, 0, 0] = 1.0
182 conn = _make_conn(1, 1, MSTDP, nu=1.0, dt=dt, tc_plus=tc, tc_minus=tc)
183 _, _, elig = _drive(conn, pre, post, torch.ones(T))
184 return elig[5].view(()).item()
185
186 assert elig_at_second_spike(pre_first=True) > 0.0
187 assert elig_at_second_spike(pre_first=False) < 0.0

Callers

nothing calls this directly

Calls 2

_make_connFunction · 0.85
_driveFunction · 0.85

Tested by

no test coverage detected