55b06faa83435b0427ad6b723fd6018f43bd9949,bindsnet/network/topology.py,SparseConnection,__init__,#SparseConnection#Any#Any#Any#Any#,614

Before Change


            i = torch.bernoulli(1 - self.sparsity * torch.ones(*source.shape, *target.shape))
            v = self.wmin + (self.wmax - self.wmin) * torch.rand(*source.shape, *target.shape)[i.byte()]
            self.w = torch.sparse.FloatTensor(i.nonzero().t(), v)
        elif self.w is not None:
            assert self.w.is_sparse, "Weight matrix is not sparse (see torch.sparse module)"

    def compute(self, s: torch.Tensor) -> torch.Tensor:

After Change


            self.w = torch.sparse.FloatTensor(i.nonzero().t(), v)
        elif self.w is not None and self.sparsity is None:
            assert self.w.is_sparse, "Weight matrix is not sparse (see torch.sparse module)"
            if self.wmin != -np.inf or self.wmax != np.inf:
                self.w = torch.clamp(self.w, self.wmin, self.wmax)

    def compute(self, s: torch.Tensor) -> torch.Tensor:
        // language=rst
        
        Compute convolutional pre-activations given spikes using layer weights.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: BindsNET/bindsnet
Commit Name: 55b06faa83435b0427ad6b723fd6018f43bd9949
Time: 2019-03-19
Author: hananel@hazan.org.il
File Name: bindsnet/network/topology.py
Class Name: SparseConnection
Method Name: __init__


Project Name: facebookresearch/Horizon
Commit Name: 64fb6b741dba1c69ff0d9901567d429b2e3abfd5
Time: 2020-09-30
Author: czxttkl@fb.com
File Name: reagent/preprocessing/preprocessor.py
Class Name: Preprocessor
Method Name: forward


Project Name: Kaixhin/Rainbow
Commit Name: cf4c3153777c4fddd15dfa09dcf04878fce5640a
Time: 2018-06-07
Author: design@kaixhin.com
File Name: agent.py
Class Name: Agent
Method Name: learn