Skip to content

Commit 50b568c

Browse files
committed
fix: correct bernoulli_loader kwarg, remove duplicate import, fix mutable default
- Fix bernoulli_loader reading 'dt' instead of 'max_prob' from kwargs in encoding/loaders.py. The docstring documents max_prob but the code was fetching the wrong key. - Remove duplicate 'import numpy as np' in network/monitors.py. - Fix mutable default argument pipeline=[] in MulticompartmentConnection.__init__. Changed to None with guard.
1 parent 6ffe6a1 commit 50b568c

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

bindsnet/encoding/loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def bernoulli_loader(
2626
:param float max_prob: Maximum probability of spike per Bernoulli trial.
2727
"""
2828
# Setting kwargs.
29-
max_prob = kwargs.get("dt", 1.0)
29+
max_prob = kwargs.get("max_prob", 1.0)
3030

3131
for i in range(len(data)):
3232
# Encode datum as Bernoulli spike trains.

bindsnet/network/monitors.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
import numpy as np
66
import torch
7-
import numpy as np
8-
9-
from abc import ABC
10-
from typing import Union, Optional, Iterable, Dict
117

128
from bindsnet.network.nodes import Nodes
139
from bindsnet.network.topology import (

bindsnet/network/topology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def __init__(
410410
source: Nodes,
411411
target: Nodes,
412412
device: device,
413-
pipeline: list = [],
413+
pipeline: Optional[list] = None,
414414
manual_update: bool = False,
415415
traces: bool = False,
416416
**kwargs,

0 commit comments

Comments
 (0)