f3ca0de6ca8c1b6b75ff0d75cc9d0e19adca7648,bindsnet/learning/__init__.py,Hebbian,_connection_update,#Hebbian#,385

Before Change


        
        Hebbian learning rule for ``Connection`` subclass of ``AbstractConnection`` class.
        
        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)

        // Pre-synaptic update.
        self.connection.w += self.nu[0] * torch.ger(source_s, target_x)
        // Post-synaptic update.
        self.connection.w += self.nu[1] * torch.ger(source_x, target_s)

        super().update()

After Change


        
        Hebbian learning rule for ``Connection`` subclass of ``AbstractConnection`` class.
        
        batch_size = self.source.batch_size

        source_s = self.source.s.view(batch_size, -1).unsqueeze(2).float()
        source_x = self.source.x.view(batch_size, -1).unsqueeze(2)
        target_s = self.target.s.view(batch_size, -1).unsqueeze(1).float()
        target_x = self.target.x.view(batch_size, -1).unsqueeze(1)

        // Pre-synaptic update.
        update = torch.bmm(source_s, target_x).sum(dim=0)
        self.connection.w += self.nu[0] * update

        // Post-synaptic update.
        update = torch.bmm(source_x, target_s).sum(dim=0)
        self.connection.w += self.nu[1] * update

        super().update()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: BindsNET/bindsnet
Commit Name: f3ca0de6ca8c1b6b75ff0d75cc9d0e19adca7648
Time: 2019-06-22
Author: djsaunde@umass.edu
File Name: bindsnet/learning/__init__.py
Class Name: Hebbian
Method Name: _connection_update


Project Name: BindsNET/bindsnet
Commit Name: f3ca0de6ca8c1b6b75ff0d75cc9d0e19adca7648
Time: 2019-06-22
Author: djsaunde@umass.edu
File Name: bindsnet/learning/__init__.py
Class Name: Hebbian
Method Name: _connection_update


Project Name: BindsNET/bindsnet
Commit Name: f3ca0de6ca8c1b6b75ff0d75cc9d0e19adca7648
Time: 2019-06-22
Author: djsaunde@umass.edu
File Name: bindsnet/learning/__init__.py
Class Name: WeightDependentPostPre
Method Name: _connection_update


Project Name: BindsNET/bindsnet
Commit Name: 8b93cb3304b8fadd82835f1016061797134997a8
Time: 2019-06-20
Author: djsaunde@umass.edu
File Name: bindsnet/learning/__init__.py
Class Name: PostPre
Method Name: _connection_update