e93d6cbd649312b7748cbd0c4b4366576f21450f,bindsnet/learning/__init__.py,MSTDP,_connection_update,#MSTDP#,272
Before Change
p_minus = a_minus * self.target.x
// Calculate point eligibility value.
eligibility = torch.ger(p_plus, self.target.s.float()) + torch.ger(self.source.s.float(), p_minus)
// Compute weight update.
self.connection.w += self.nu[0] * reward * eligibility
After Change
source_s = self.source.s.view(-1).float()
source_x = self.source.x.view(-1)
target_s = self.target.s.view(-1).float()
target_x = self.target.x.view(-1)
shape = self.connection.w.shape
self.connection.w = self.connection.w.view(self.source.n, self.target.n)
// Parse keyword arguments.
reward = kwargs["reward"]
a_plus = kwargs.get("a_plus", 1)
a_minus = kwargs.get("a_plus", -1)
// Get P^+ and P^- values (function of firing traces).
p_plus = a_plus * source_x
p_minus = a_minus * target_x
// Calculate point eligibility value.
eligibility = torch.ger(p_plus, target_s) + torch.ger(source_s, p_minus)
// Compute weight update.
self.connection.w += self.nu[0] * reward * eligibility
self.connection.w = self.connection.w.view(*shape)
def _conv2d_connection_update(self, **kwargs) -> None:
// language=rst
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: BindsNET/bindsnet
Commit Name: e93d6cbd649312b7748cbd0c4b4366576f21450f
Time: 2018-09-24
Author: djsaunde@umass.edu
File Name: bindsnet/learning/__init__.py
Class Name: MSTDP
Method Name: _connection_update
Project Name: ncullen93/torchsample
Commit Name: 943753c968fe7c0cbafc6e44d60f1b28b42e997b
Time: 2017-05-03
Author: ncullen.th@dartmouth.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_nearest_interp2d
Project Name: ultralytics/yolov3
Commit Name: 6116acb8c20ba523fe54111341032c6aec94ead3
Time: 2018-09-09
Author: glenn.jocher@ultralytics.com
File Name: utils/utils.py
Class Name:
Method Name: build_targets
Project Name: ncullen93/torchsample
Commit Name: 943753c968fe7c0cbafc6e44d60f1b28b42e997b
Time: 2017-05-03
Author: ncullen.th@dartmouth.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_affine2d