Skip to content

Commit

Permalink
#488 fix dimensions issues
Browse files Browse the repository at this point in the history
#488 fix dimensions issues with layers with different shape
  • Loading branch information
Hananel-Hazan committed May 19, 2021
1 parent ea593ad commit 159cabe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bindsnet/learning/learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,13 @@ def _connection_update(self, **kwargs) -> None:
# Initialize eligibility, P^+, and P^-.
if not hasattr(self, "p_plus"):
self.p_plus = torch.zeros(
batch_size, *self.source.shape, device=self.source.s.device
#batch_size, *self.source.shape, device=self.source.s.device
batch_size, self.source.n, device=self.source.s.device
)
if not hasattr(self, "p_minus"):
self.p_minus = torch.zeros(
batch_size, *self.target.shape, device=self.target.s.device
# batch_size, *self.target.shape, device=self.target.s.device
batch_size, self.target.n, device=self.target.s.device
)
if not hasattr(self, "eligibility"):
self.eligibility = torch.zeros(
Expand Down

0 comments on commit 159cabe

Please sign in to comment.