diff --git a/.gitignore b/.gitignore index 197e3bb3..71aadef8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ test/models/__pycache__/* test/network/__pycache__/* test/analysis/__pycache__/* *.pyc +**/*.pyc dist/* logs/* .pytest_cache/* diff --git a/bindsnet/__pycache__/__init__.cpython-310.pyc b/bindsnet/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index b69fecbe..00000000 Binary files a/bindsnet/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/__pycache__/utils.cpython-310.pyc b/bindsnet/__pycache__/utils.cpython-310.pyc deleted file mode 100644 index 29d33ba0..00000000 Binary files a/bindsnet/__pycache__/utils.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/analysis/__pycache__/__init__.cpython-310.pyc b/bindsnet/analysis/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 0a28eb47..00000000 Binary files a/bindsnet/analysis/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/analysis/__pycache__/pipeline_analysis.cpython-310.pyc b/bindsnet/analysis/__pycache__/pipeline_analysis.cpython-310.pyc deleted file mode 100644 index 8482a745..00000000 Binary files a/bindsnet/analysis/__pycache__/pipeline_analysis.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/analysis/__pycache__/plotting.cpython-310.pyc b/bindsnet/analysis/__pycache__/plotting.cpython-310.pyc deleted file mode 100644 index 916d80c4..00000000 Binary files a/bindsnet/analysis/__pycache__/plotting.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/analysis/__pycache__/visualization.cpython-310.pyc b/bindsnet/analysis/__pycache__/visualization.cpython-310.pyc deleted file mode 100644 index 2f817c76..00000000 Binary files a/bindsnet/analysis/__pycache__/visualization.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/conversion/__pycache__/__init__.cpython-310.pyc b/bindsnet/conversion/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index feacf5b7..00000000 Binary files a/bindsnet/conversion/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/conversion/__pycache__/conversion.cpython-310.pyc b/bindsnet/conversion/__pycache__/conversion.cpython-310.pyc deleted file mode 100644 index aa962d24..00000000 Binary files a/bindsnet/conversion/__pycache__/conversion.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/conversion/__pycache__/nodes.cpython-310.pyc b/bindsnet/conversion/__pycache__/nodes.cpython-310.pyc deleted file mode 100644 index e9ce3a49..00000000 Binary files a/bindsnet/conversion/__pycache__/nodes.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/conversion/__pycache__/topology.cpython-310.pyc b/bindsnet/conversion/__pycache__/topology.cpython-310.pyc deleted file mode 100644 index 179ac233..00000000 Binary files a/bindsnet/conversion/__pycache__/topology.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/__init__.cpython-310.pyc b/bindsnet/datasets/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index b51f6946..00000000 Binary files a/bindsnet/datasets/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/alov300.cpython-310.pyc b/bindsnet/datasets/__pycache__/alov300.cpython-310.pyc deleted file mode 100644 index 0b984934..00000000 Binary files a/bindsnet/datasets/__pycache__/alov300.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/collate.cpython-310.pyc b/bindsnet/datasets/__pycache__/collate.cpython-310.pyc deleted file mode 100644 index 856bb942..00000000 Binary files a/bindsnet/datasets/__pycache__/collate.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/dataloader.cpython-310.pyc b/bindsnet/datasets/__pycache__/dataloader.cpython-310.pyc deleted file mode 100644 index bcad70c5..00000000 Binary files a/bindsnet/datasets/__pycache__/dataloader.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/davis.cpython-310.pyc b/bindsnet/datasets/__pycache__/davis.cpython-310.pyc deleted file mode 100644 index 60c0ee11..00000000 Binary files a/bindsnet/datasets/__pycache__/davis.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/preprocess.cpython-310.pyc b/bindsnet/datasets/__pycache__/preprocess.cpython-310.pyc deleted file mode 100644 index 432de202..00000000 Binary files a/bindsnet/datasets/__pycache__/preprocess.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/spoken_mnist.cpython-310.pyc b/bindsnet/datasets/__pycache__/spoken_mnist.cpython-310.pyc deleted file mode 100644 index 274a50d7..00000000 Binary files a/bindsnet/datasets/__pycache__/spoken_mnist.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/datasets/__pycache__/torchvision_wrapper.cpython-310.pyc b/bindsnet/datasets/__pycache__/torchvision_wrapper.cpython-310.pyc deleted file mode 100644 index 4d03c625..00000000 Binary files a/bindsnet/datasets/__pycache__/torchvision_wrapper.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/encoding/__pycache__/__init__.cpython-310.pyc b/bindsnet/encoding/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 27ae69a3..00000000 Binary files a/bindsnet/encoding/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/encoding/__pycache__/encoders.cpython-310.pyc b/bindsnet/encoding/__pycache__/encoders.cpython-310.pyc deleted file mode 100644 index 0b74cf42..00000000 Binary files a/bindsnet/encoding/__pycache__/encoders.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/encoding/__pycache__/encodings.cpython-310.pyc b/bindsnet/encoding/__pycache__/encodings.cpython-310.pyc deleted file mode 100644 index f7082471..00000000 Binary files a/bindsnet/encoding/__pycache__/encodings.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/encoding/__pycache__/loaders.cpython-310.pyc b/bindsnet/encoding/__pycache__/loaders.cpython-310.pyc deleted file mode 100644 index 5915414a..00000000 Binary files a/bindsnet/encoding/__pycache__/loaders.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/environment/__pycache__/__init__.cpython-310.pyc b/bindsnet/environment/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 88a73cf6..00000000 Binary files a/bindsnet/environment/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/environment/__pycache__/environment.cpython-310.pyc b/bindsnet/environment/__pycache__/environment.cpython-310.pyc deleted file mode 100644 index da3dc8b8..00000000 Binary files a/bindsnet/environment/__pycache__/environment.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/evaluation/__pycache__/__init__.cpython-310.pyc b/bindsnet/evaluation/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index f5cb7f23..00000000 Binary files a/bindsnet/evaluation/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/evaluation/__pycache__/evaluation.cpython-310.pyc b/bindsnet/evaluation/__pycache__/evaluation.cpython-310.pyc deleted file mode 100644 index 2ccc3832..00000000 Binary files a/bindsnet/evaluation/__pycache__/evaluation.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/learning/__pycache__/__init__.cpython-310.pyc b/bindsnet/learning/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 6289cc4c..00000000 Binary files a/bindsnet/learning/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/learning/__pycache__/learning.cpython-310.pyc b/bindsnet/learning/__pycache__/learning.cpython-310.pyc deleted file mode 100644 index 099de4fe..00000000 Binary files a/bindsnet/learning/__pycache__/learning.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/learning/__pycache__/reward.cpython-310.pyc b/bindsnet/learning/__pycache__/reward.cpython-310.pyc deleted file mode 100644 index 06358553..00000000 Binary files a/bindsnet/learning/__pycache__/reward.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/models/__pycache__/__init__.cpython-310.pyc b/bindsnet/models/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 4b00cfdf..00000000 Binary files a/bindsnet/models/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/models/__pycache__/models.cpython-310.pyc b/bindsnet/models/__pycache__/models.cpython-310.pyc deleted file mode 100644 index a5c96c22..00000000 Binary files a/bindsnet/models/__pycache__/models.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/models/models.py b/bindsnet/models/models.py index cd1d7639..04ff3361 100644 --- a/bindsnet/models/models.py +++ b/bindsnet/models/models.py @@ -112,6 +112,7 @@ def __init__( reduction: Optional[callable] = None, wmin: float = 0.0, wmax: float = 1.0, + w_dtype: torch.dtype = torch.float32, norm: float = 78.4, theta_plus: float = 0.05, tc_theta_decay: float = 1e7, @@ -134,6 +135,7 @@ def __init__( dimension. :param wmin: Minimum allowed weight on input to excitatory synapses. :param wmax: Maximum allowed weight on input to excitatory synapses. + :param w_dtype: Data type for :code:`w` tensor :param norm: Input to excitatory layer connection weights normalization constant. :param theta_plus: On-spike increment of ``DiehlAndCookNodes`` membrane @@ -188,6 +190,7 @@ def __init__( Weight( "weight", w, + value_dtype=w_dtype, range=[wmin, wmax], norm=norm, reduction=reduction, @@ -205,7 +208,11 @@ def __init__( source=exc_layer, target=inh_layer, device=device, - pipeline=[Weight("weight", w, range=[0, self.exc], sparse=sparse)], + pipeline=[ + Weight( + "weight", w, value_dtype=w_dtype, range=[0, self.exc], sparse=sparse + ) + ], ) w = -self.inh * ( torch.ones(self.n_neurons, self.n_neurons) @@ -217,7 +224,15 @@ def __init__( source=inh_layer, target=exc_layer, device=device, - pipeline=[Weight("weight", w, range=[-self.inh, 0], sparse=sparse)], + pipeline=[ + Weight( + "weight", + w, + value_dtype=w_dtype, + range=[-self.inh, 0], + sparse=sparse, + ) + ], ) # Add to network diff --git a/bindsnet/network/__pycache__/__init__.cpython-310.pyc b/bindsnet/network/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index d24bf0a9..00000000 Binary files a/bindsnet/network/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/network/__pycache__/monitors.cpython-310.pyc b/bindsnet/network/__pycache__/monitors.cpython-310.pyc deleted file mode 100644 index d0bec1c2..00000000 Binary files a/bindsnet/network/__pycache__/monitors.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/network/__pycache__/network.cpython-310.pyc b/bindsnet/network/__pycache__/network.cpython-310.pyc deleted file mode 100644 index 8cd220a6..00000000 Binary files a/bindsnet/network/__pycache__/network.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/network/__pycache__/nodes.cpython-310.pyc b/bindsnet/network/__pycache__/nodes.cpython-310.pyc deleted file mode 100644 index fa8f1b06..00000000 Binary files a/bindsnet/network/__pycache__/nodes.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/network/__pycache__/topology.cpython-310.pyc b/bindsnet/network/__pycache__/topology.cpython-310.pyc deleted file mode 100644 index 1d55aea8..00000000 Binary files a/bindsnet/network/__pycache__/topology.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/network/topology.py b/bindsnet/network/topology.py index 442e9a15..10df4582 100644 --- a/bindsnet/network/topology.py +++ b/bindsnet/network/topology.py @@ -145,6 +145,16 @@ def reset_state_variables(self) -> None: Contains resetting logic for the connection. """ + @staticmethod + def cast_dtype_if_needed(w, w_dtype): + if w.dtype != w_dtype: + warnings.warn( + f"Provided w has data type {w.dtype} but parameter w_dtype is {w_dtype}" + ) + return w.to(dtype=w_dtype) + else: + return w + class AbstractMulticompartmentConnection(ABC, Module): # language=rst @@ -265,6 +275,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -279,6 +290,7 @@ def __init__( :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: @@ -300,9 +312,11 @@ def __init__( w = torch.clamp(torch.rand(source.n, target.n), self.wmin, self.wmax) else: w = self.wmin + torch.rand(source.n, target.n) * (self.wmax - self.wmin) + w = w.to(dtype=w_dtype) else: if (self.wmin != -np.inf).any() or (self.wmax != np.inf).any(): w = torch.clamp(torch.as_tensor(w), self.wmin, self.wmax) + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) @@ -540,6 +554,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -558,6 +573,7 @@ def __init__( :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: @@ -610,9 +626,11 @@ def __init__( self.out_channels, self.in_channels, self.kernel_size ) w += self.wmin + w = w.to(dtype=w_dtype) else: if (self.wmin == -inf).any() or (self.wmax == inf).any(): w = torch.clamp(w, self.wmin, self.wmax) + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) self.b = Parameter( @@ -682,6 +700,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -700,6 +719,7 @@ def __init__( :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: @@ -765,9 +785,11 @@ def __init__( self.out_channels, self.in_channels, *self.kernel_size ) w += self.wmin + w = w.to(dtype=w_dtype) else: if (self.wmin == -inf).any() or (self.wmax == inf).any(): w = torch.clamp(w, self.wmin, self.wmax) + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) self.b = Parameter( @@ -839,6 +861,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -857,6 +880,7 @@ def __init__( :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: @@ -941,9 +965,11 @@ def __init__( self.out_channels, self.in_channels, *self.kernel_size ) w += self.wmin + w = w.to(dtype=w_dtype) else: if (self.wmin == -inf).any() or (self.wmax == inf).any(): w = torch.clamp(w, self.wmin, self.wmax) + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) self.b = Parameter( @@ -1291,6 +1317,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -1314,6 +1341,7 @@ def __init__( :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: @@ -1393,10 +1421,11 @@ def __init__( w = torch.clamp(w, self.wmin, self.wmax) else: w = self.wmin + w * (self.wmax - self.wmin) - + w = w.to(dtype=w_dtype) else: if (self.wmin != -np.inf).any() or (self.wmax != np.inf).any(): w = torch.clamp(w, self.wmin, self.wmax) + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) @@ -1471,6 +1500,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: """ @@ -1489,6 +1519,7 @@ def __init__( In this case, their shape should be the same size as the connection weights. :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: :param LearningRule update_rule: Modifies connection parameters according to some rule. :param torch.Tensor w: Strengths of synapses. @@ -1522,12 +1553,14 @@ def __init__( w = torch.rand( self.in_channels, self.n_filters * self.conv_size, self.kernel_size ) + w = w.to(dtype=w_dtype) else: assert w.shape == ( self.in_channels, self.out_channels * self.conv_size, self.kernel_size, ), error + w = self.cast_dtype_if_needed(w, w_dtype) if self.wmin != -np.inf or self.wmax != np.inf: w = torch.clamp(w, self.wmin, self.wmax) @@ -1603,6 +1636,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: """ @@ -1621,6 +1655,7 @@ def __init__( In this case, their shape should be the same size as the connection weights. :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: :param LearningRule update_rule: Modifies connection parameters according to some rule. :param torch.Tensor w: Strengths of synapses. @@ -1664,12 +1699,14 @@ def __init__( w = torch.rand( self.in_channels, self.n_filters * self.conv_prod, self.kernel_prod ) + w = w.to(dtype=w_dtype) else: assert w.shape == ( self.in_channels, self.out_channels * self.conv_prod, self.kernel_prod, ), error + w = self.cast_dtype_if_needed(w, w_dtype) if self.wmin != -np.inf or self.wmax != np.inf: w = torch.clamp(w, self.wmin, self.wmax) @@ -1746,6 +1783,7 @@ def __init__( nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, reduction: Optional[callable] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: """ @@ -1764,6 +1802,7 @@ def __init__( In this case, their shape should be the same size as the connection weights. :param reduction: Method for reducing parameter updates along the minibatch dimension. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: :param LearningRule update_rule: Modifies connection parameters according to some rule. :param torch.Tensor w: Strengths of synapses. @@ -1809,12 +1848,14 @@ def __init__( w = torch.rand( self.in_channels, self.n_filters * self.conv_prod, self.kernel_prod ) + w = w.to(dtype=w_dtype) else: assert w.shape == ( self.in_channels, self.out_channels * self.conv_prod, self.kernel_prod, ), error + w = self.cast_dtype_if_needed(w, w_dtype) if self.wmin != -np.inf or self.wmax != np.inf: w = torch.clamp(w, self.wmin, self.wmax) @@ -1890,6 +1931,7 @@ def __init__( target: Nodes, nu: Optional[Union[float, Sequence[float], Sequence[torch.Tensor]]] = None, weight_decay: float = 0.0, + w_dtype: torch.dtype = torch.float32, **kwargs, ) -> None: # language=rst @@ -1901,6 +1943,7 @@ def __init__( accepts a pair of tensors to individualize learning rates of each neuron. In this case, their shape should be the same size as the connection weights. :param weight_decay: Constant multiple to decay weights by on each iteration. + :param w_dtype: Data type for :code:`w` tensor Keyword arguments: :param LearningRule update_rule: Modifies connection parameters according to some rule. @@ -1919,10 +1962,11 @@ def __init__( w = torch.clamp((torch.randn(1)[0] + 1) / 10, self.wmin, self.wmax) else: w = self.wmin + ((torch.randn(1)[0] + 1) / 10) * (self.wmax - self.wmin) + w = w.to(dtype=w_dtype) else: if (self.wmin == -np.inf).any() or (self.wmax == np.inf).any(): w = torch.clamp(w, self.wmin, self.wmax) - + w = self.cast_dtype_if_needed(w, w_dtype) self.w = Parameter(w, requires_grad=False) def compute(self, s: torch.Tensor) -> torch.Tensor: diff --git a/bindsnet/network/topology_features.py b/bindsnet/network/topology_features.py index d3186f53..43ccc138 100644 --- a/bindsnet/network/topology_features.py +++ b/bindsnet/network/topology_features.py @@ -4,6 +4,7 @@ import numpy as np import torch +import warnings from torch import device from torch.nn import Parameter import torch.nn.functional as F @@ -22,6 +23,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, range: Optional[Union[list, tuple]] = None, clamp_frequency: Optional[int] = 1, norm: Optional[Union[torch.Tensor, float, int]] = None, @@ -40,6 +42,7 @@ def __init__( Instantiates a :code:`Feature` object. Will assign all incoming arguments as class variables :param name: Name of the feature :param value: Core numeric object for the feature. This parameters function will vary depending on the feature + :param value_dtype: Data type for :code:`value` tensor :param range: Range of acceptable values for the :code:`value` parameter :param norm: Value which all values in :code:`value` will sum to. Normalization of values occurs after each sample and after the value has been updated by the learning rule (if there is one) @@ -127,6 +130,7 @@ def __init__( return self.assert_feature_in_range() + self.value = self.cast_dtype_if_needed(self.value, value_dtype) if not self.sparse: return @@ -138,6 +142,16 @@ def __init__( self, "enforce_polarity", False ), "enforce_polarity isn't supported for sparse tensors" + @staticmethod + def cast_dtype_if_needed(value, value_dtype): + if value.dtype != value_dtype: + warnings.warn( + f"Provided value has data type {value.dtype} but parameter w_dtype is {value_dtype}" + ) + return value.to(dtype=value_dtype) + else: + return value + @abstractmethod def reset_state_variables(self) -> None: # language=rst @@ -353,6 +367,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, range: Optional[Sequence[float]] = None, norm: Optional[Union[torch.Tensor, float, int]] = None, learning_rule: Optional[bindsnet.learning.LearningRule] = None, @@ -370,6 +385,7 @@ def __init__( :param value: Number(s) in [0, 1] which represent the probability of a signal traversing a synapse. Tensor values assume that probabilities will be matched to adjacent synapses in the connection. Scalars will be applied to all synapses. + :param value_dtype: Data type for :code:`value` tensor :param range: Range of acceptable values for the :code:`value` parameter. Should be in [0, 1] :param norm: Value which all values in :code:`value` will sum to. Normalization of values occurs after each sample and after the value has been updated by the learning rule (if there is one) @@ -387,6 +403,7 @@ def __init__( super().__init__( name=name, value=value, + value_dtype=value_dtype, range=[0, 1] if range is None else range, norm=norm, learning_rule=learning_rule, @@ -477,7 +494,15 @@ def __init__( # Send boolean to tensor (priming wont work if it's not a tensor) value = torch.tensor(value) - super().__init__(name=name, value=value, sparse=sparse, batch_size=batch_size) + super().__init__( + name=name, + value=value, + value_dtype=torch.bool, + sparse=sparse, + batch_size=batch_size, + ) + self.name = name + self.value = value def compute(self, conn_spikes) -> torch.Tensor: return conn_spikes * self.value @@ -552,6 +577,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, range: Optional[Sequence[float]] = None, norm: Optional[Union[torch.Tensor, float, int]] = None, norm_frequency: Optional[str] = "sample", @@ -568,6 +594,7 @@ def __init__( Multiplies signals by scalars :param name: Name of the feature :param value: Values to scale signals by + :param value_dtype: Data type for :code:`value` tensor :param range: Range of acceptable values for the :code:`value` parameter :param norm: Value which all values in :code:`value` will sum to. Normalization of values occurs after each sample and after the value has been updated by the learning rule (if there is one) @@ -589,6 +616,7 @@ def __init__( super().__init__( name=name, value=value, + value_dtype=value_dtype, range=[-torch.inf, +torch.inf] if range is None else range, norm=norm, learning_rule=learning_rule, @@ -648,6 +676,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, range: Optional[Sequence[float]] = None, norm: Optional[Union[torch.Tensor, float, int]] = None, sparse: Optional[bool] = False, @@ -658,6 +687,7 @@ def __init__( Adds scalars to signals :param name: Name of the feature :param value: Values to add to the signals + :param value_dtype: Data type for :code:`value` tensor :param range: Range of acceptable values for the :code:`value` parameter :param norm: Value which all values in :code:`value` will sum to. Normalization of values occurs after each sample and after the value has been updated by the learning rule (if there is one) @@ -668,6 +698,7 @@ def __init__( super().__init__( name=name, value=value, + value_dtype=value_dtype, range=[-torch.inf, +torch.inf] if range is None else range, norm=norm, sparse=sparse, @@ -695,6 +726,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, range: Optional[Sequence[float]] = None, sparse: Optional[bool] = False, batch_size: int = 1, @@ -704,12 +736,17 @@ def __init__( Adds scalars to signals :param name: Name of the feature :param value: Values to scale signals by + :param value_dtype: Data type for :code:`value` tensor :param sparse: Should :code:`value` parameter be sparse tensor or not :param batch_size: Mini-batch size. """ - super().__init__( - name=name, value=value, range=range, sparse=sparse, batch_size=batch_size + name=name, + value=value, + value_dtype=value_dtype, + range=range, + sparse=sparse, + batch_size=batch_size, ) def reset_state_variables(self) -> None: @@ -737,6 +774,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, degrade_function: callable = None, parent_feature: Optional[AbstractFeature] = None, sparse: Optional[bool] = False, @@ -748,6 +786,7 @@ def __init__( Note: If :code:`parent_feature` is provided, it will override :code:`value`. :param name: Name of the feature :param value: Value used to degrade feature + :param value_dtype: Data type for :code:`value` tensor :param degrade_function: Callable function which takes a single argument (:code:`value`) and returns a tensor or constant to be *subtracted* from the propagating spikes. :param parent_feature: Parent feature with desired :code:`value` to inherit @@ -759,6 +798,7 @@ def __init__( super().__init__( name=name, value=value, + value_dtype=value_dtype, parent_feature=parent_feature, sparse=sparse, batch_size=batch_size, @@ -778,6 +818,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, ann_values: Union[list, tuple] = None, const_update_rate: float = 0.1, const_decay: float = 0.001, @@ -797,6 +838,9 @@ def __init__( :param batch_size: Mini-batch size. """ + self.value_dtype = value_dtype + value = value.to(self.value_dtype) + # Define the ANN class ANN(nn.Module): def __init__(self, input_size, hidden_size, output_size): @@ -830,7 +874,13 @@ def forward(self, x): self.const_update_rate = const_update_rate self.const_decay = const_decay - super().__init__(name=name, value=value, sparse=sparse, batch_size=batch_size) + super().__init__( + name=name, + value=value, + value_dtype=self.value_dtype, + sparse=sparse, + batch_size=batch_size, + ) def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: @@ -849,7 +899,7 @@ def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: # Update the masks if self.counter % self.spike_buffer.shape[1] == 0: with torch.no_grad(): - ann_decision = self.ann(self.spike_buffer.to(torch.float32)) + ann_decision = self.ann(self.spike_buffer.to(self.value_dtype)) self.mask += ( ann_decision.view(self.mask.shape) * self.const_update_rate ) # update mask with learning rate fraction @@ -857,7 +907,7 @@ def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: self.mask = torch.clamp(self.mask, -1, 1) # cap the mask # self.mask = torch.clamp(self.mask, -1, 1) - self.value = (self.mask > 0).float() + self.value = (self.mask > 0).to(self.value_dtype) if self.sparse: self.value = self.value.to_sparse() @@ -878,6 +928,7 @@ def __init__( self, name: str, value: Union[torch.Tensor, float, int] = None, + value_dtype: torch.dtype = torch.float32, ann_values: Union[list, tuple] = None, const_update_rate: float = 0.1, const_decay: float = 0.01, @@ -891,11 +942,14 @@ def __init__( :param name: Name of the feature :param ann_values: Values to be use to build an ANN that will adapt the connectivity of the layer. :param value: Values to be use to build an initial mask for the synapses. + :param value_dtype: Data type for :code:`value` tensor :param const_update_rate: The mask upatate rate of the ANN decision. :param const_decay: The spontaneous activation of the synapses. :param sparse: Should :code:`value` parameter be sparse tensor or not :param batch_size: Mini-batch size. """ + self.value_dtype = value_dtype + value = value.to(self.value_dtype) # Define the ANN class ANN(nn.Module): @@ -930,7 +984,13 @@ def forward(self, x): self.const_update_rate = const_update_rate self.const_decay = const_decay - super().__init__(name=name, value=value, sparse=sparse, batch_size=batch_size) + super().__init__( + name=name, + value=value, + value_dtype=self.value_dtype, + sparse=sparse, + batch_size=batch_size, + ) def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: @@ -949,7 +1009,7 @@ def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: # Update the masks if self.counter % self.spike_buffer.shape[1] == 0: with torch.no_grad(): - ann_decision = self.ann(self.spike_buffer.to(torch.float32)) + ann_decision = self.ann(self.spike_buffer.to(self.value_dtype)) self.mask += ( ann_decision.view(self.mask.shape) * self.const_update_rate ) # update mask with learning rate fraction @@ -957,7 +1017,7 @@ def compute(self, conn_spikes) -> Union[torch.Tensor, float, int]: self.mask = torch.clamp(self.mask, -1, 1) # cap the mask # self.mask = torch.clamp(self.mask, -1, 1) - self.value = (self.mask > 0).float() + self.value = (self.mask > 0).to(self.value_dtype) if self.sparse: self.value = self.value.to_sparse() diff --git a/bindsnet/pipeline/__pycache__/__init__.cpython-310.pyc b/bindsnet/pipeline/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 1316877f..00000000 Binary files a/bindsnet/pipeline/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/pipeline/__pycache__/action.cpython-310.pyc b/bindsnet/pipeline/__pycache__/action.cpython-310.pyc deleted file mode 100644 index bc066cb0..00000000 Binary files a/bindsnet/pipeline/__pycache__/action.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/pipeline/__pycache__/base_pipeline.cpython-310.pyc b/bindsnet/pipeline/__pycache__/base_pipeline.cpython-310.pyc deleted file mode 100644 index 4d1c2c36..00000000 Binary files a/bindsnet/pipeline/__pycache__/base_pipeline.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/pipeline/__pycache__/dataloader_pipeline.cpython-310.pyc b/bindsnet/pipeline/__pycache__/dataloader_pipeline.cpython-310.pyc deleted file mode 100644 index 29a9039a..00000000 Binary files a/bindsnet/pipeline/__pycache__/dataloader_pipeline.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/pipeline/__pycache__/environment_pipeline.cpython-310.pyc b/bindsnet/pipeline/__pycache__/environment_pipeline.cpython-310.pyc deleted file mode 100644 index 88e638b0..00000000 Binary files a/bindsnet/pipeline/__pycache__/environment_pipeline.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/preprocessing/__pycache__/__init__.cpython-310.pyc b/bindsnet/preprocessing/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index dd1e526d..00000000 Binary files a/bindsnet/preprocessing/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/bindsnet/preprocessing/__pycache__/preprocessing.cpython-310.pyc b/bindsnet/preprocessing/__pycache__/preprocessing.cpython-310.pyc deleted file mode 100644 index 86c739a8..00000000 Binary files a/bindsnet/preprocessing/__pycache__/preprocessing.cpython-310.pyc and /dev/null differ diff --git a/docs/source/guide/guide_part_i.rst b/docs/source/guide/guide_part_i.rst index dd067204..20414e76 100644 --- a/docs/source/guide/guide_part_i.rst +++ b/docs/source/guide/guide_part_i.rst @@ -447,3 +447,53 @@ their simulation separately at the temporal granularity of chosen :code:`dt`, in This is a strict departure from the computation of *deep neural networks* (DNNs), in which an ordering of layers is supposed, and layers' activations are computed *in sequence* from the shallowest to the deepest layer in a single time step, with the exclusion of recurrent layers, whose computations are still ordered in time. + + +Lowering precision +------------------ + +You can choose the precision for the weights. +It can be specified as the :code:`value_dtype` parameter of the Weight class. + +.. code-block:: python + + MulticompartmentConnection( + ... + pipeline=[ + Weight( + 'weight', + w, + value_dtype='float16', + ... + ) + ] + ) + +Below is the performance statistics for float16 and float32. + +The data was obtained by running examples/benchmark/lowering_precision.py + + +.. code-block:: text + + precision: float32 + Time (sec) | GPU memory (Mb) + 19.7812 | 52 + 19.4812 | 52 + 19.0769 | 52 + 19.1530 | 52 + Average time: 19.373075 + Average memory: 52.0 + + precision: float16 + Time (sec) | GPU memory (Mb) + 19.5023 | 49 + 20.5734 | 49 + 19.8735 | 49 + 19.8931 | 49 + Average time: 19.960575 + Average memory: 49.0 + + +As you can see, reducing from float32 to float16 does not provide a significant advantage in terms of time or memory. +The float16 option only reduces memory usage by 6%. \ No newline at end of file diff --git a/examples/benchmark/lowering_precision.py b/examples/benchmark/lowering_precision.py new file mode 100644 index 00000000..c3927b0c --- /dev/null +++ b/examples/benchmark/lowering_precision.py @@ -0,0 +1,50 @@ +import re +import os +import subprocess +from statistics import mean + +precision_sample_size = 4 +precisions = ["float16", "float32"] + +folder = os.path.dirname(os.path.dirname(__file__)) +script = os.path.join(folder, "mnist", "batch_eth_mnist.py") +data = {} +for precision in precisions: + for _ in range(precision_sample_size): + result = subprocess.run( + f"python {script} --n_train 100 --batch_size 50 --n_test 10 --n_updates 1 --w_dtype {precision}", + shell=True, + capture_output=True, + text=True, + ) + output = result.stdout + time_match = re.search(r"Progress: 1 / 1 \((\d+\.\d+) seconds\)", output) + memory_match = re.search(r"Memory consumption: (\d+)mb", output) + data.setdefault(precision, []).append( + [time_match.groups()[0], memory_match.groups()[0]] + ) + print("+") + + +def print_table(data): + column_widths = [max(len(str(item)) for item in col) for col in zip(*data)] + for row in data: + formatted_row = " | ".join( + f"{str(item):<{column_widths[i]}}" for i, item in enumerate(row) + ) + print(formatted_row) + + +average_time = {} +average_memory = {} +for precision, rows in data.items(): + print(f"precision: {precision}") + table = [["Time (sec)", "GPU memory (Mb)"]] + rows + avg_time = mean(map(lambda i: float(i[0]), rows)) + avg_memory = mean(map(lambda i: float(i[1]), rows)) + print_table(table) + print(f"Average time: {avg_time}") + print(f"Average memory: {avg_memory}") + average_memory[precision] = avg_memory + average_time[precision] = avg_time + print("") diff --git a/examples/mnist/batch_eth_mnist.py b/examples/mnist/batch_eth_mnist.py index 65fc37d6..5a53ea04 100644 --- a/examples/mnist/batch_eth_mnist.py +++ b/examples/mnist/batch_eth_mnist.py @@ -40,6 +40,12 @@ parser.add_argument("--dt", type=int, default=1.0) parser.add_argument("--intensity", type=float, default=128) parser.add_argument("--progress_interval", type=int, default=10) +parser.add_argument( + "--w_dtype", + type=str, + default="float32", + help="Datatype to use for weights. Examples: float32, float16, bfloat16 etc", +) parser.add_argument("--train", dest="train", action="store_true") parser.add_argument("--test", dest="train", action="store_false") parser.add_argument("--plot", dest="plot", action="store_true") @@ -107,6 +113,8 @@ nu=(1e-4, 1e-2), theta_plus=theta_plus, inpt_shape=(1, 28, 28), + device=device, + w_dtype=getattr(torch, args.w_dtype), ) # Directs network to GPU @@ -391,6 +399,9 @@ print("\nAll activity accuracy: %.2f" % (accuracy["all"] / n_test)) print("Proportion weighting accuracy: %.2f \n" % (accuracy["proportion"] / n_test)) +print( + f"Memory consumption: {round(torch.cuda.max_memory_allocated(device=None) / 1024 ** 2)}mb" +) print("Progress: %d / %d (%.4f seconds)" % (epoch + 1, n_epochs, t() - start)) print("\nTesting complete.\n") diff --git a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-7.4.4.pyc b/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 7bed2960..00000000 Binary files a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.1.1.pyc b/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 7bed2960..00000000 Binary files a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.2.2.pyc b/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index b1a7536e..00000000 Binary files a/test/analysis/__pycache__/test_analyzers.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-7.4.4.pyc b/test/conversion/__pycache__/test_conversion.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 608608f0..00000000 Binary files a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.1.1.pyc b/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 608608f0..00000000 Binary files a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.2.2.pyc b/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index e12e1822..00000000 Binary files a/test/conversion/__pycache__/test_conversion.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-7.4.4.pyc b/test/encoding/__pycache__/test_encoding.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 024727cb..00000000 Binary files a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.1.1.pyc b/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 024727cb..00000000 Binary files a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.2.2.pyc b/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index f03e5b6a..00000000 Binary files a/test/encoding/__pycache__/test_encoding.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/import/__pycache__/test_import.cpython-310-pytest-7.4.4.pyc b/test/import/__pycache__/test_import.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 067df56d..00000000 Binary files a/test/import/__pycache__/test_import.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/import/__pycache__/test_import.cpython-310-pytest-8.1.1.pyc b/test/import/__pycache__/test_import.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 067df56d..00000000 Binary files a/test/import/__pycache__/test_import.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/import/__pycache__/test_import.cpython-310-pytest-8.2.2.pyc b/test/import/__pycache__/test_import.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index 067df56d..00000000 Binary files a/test/import/__pycache__/test_import.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/models/__pycache__/test_models.cpython-310-pytest-7.4.4.pyc b/test/models/__pycache__/test_models.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 5ecf1176..00000000 Binary files a/test/models/__pycache__/test_models.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/models/__pycache__/test_models.cpython-310-pytest-8.1.1.pyc b/test/models/__pycache__/test_models.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 5ecf1176..00000000 Binary files a/test/models/__pycache__/test_models.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/models/__pycache__/test_models.cpython-310-pytest-8.2.2.pyc b/test/models/__pycache__/test_models.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index 8b9c2002..00000000 Binary files a/test/models/__pycache__/test_models.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_connections.cpython-310-pytest-7.4.4.pyc b/test/network/__pycache__/test_connections.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 2ed35151..00000000 Binary files a/test/network/__pycache__/test_connections.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_connections.cpython-310-pytest-8.1.1.pyc b/test/network/__pycache__/test_connections.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 2ed35151..00000000 Binary files a/test/network/__pycache__/test_connections.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_connections.cpython-310-pytest-8.2.2.pyc b/test/network/__pycache__/test_connections.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index dbdda889..00000000 Binary files a/test/network/__pycache__/test_connections.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_learning.cpython-310-pytest-7.4.4.pyc b/test/network/__pycache__/test_learning.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index c7c83f1d..00000000 Binary files a/test/network/__pycache__/test_learning.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_learning.cpython-310-pytest-8.1.1.pyc b/test/network/__pycache__/test_learning.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index c7c83f1d..00000000 Binary files a/test/network/__pycache__/test_learning.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_learning.cpython-310-pytest-8.2.2.pyc b/test/network/__pycache__/test_learning.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index acf60e50..00000000 Binary files a/test/network/__pycache__/test_learning.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_monitors.cpython-310-pytest-7.4.4.pyc b/test/network/__pycache__/test_monitors.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index c7d1c3fc..00000000 Binary files a/test/network/__pycache__/test_monitors.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_monitors.cpython-310-pytest-8.1.1.pyc b/test/network/__pycache__/test_monitors.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index c7d1c3fc..00000000 Binary files a/test/network/__pycache__/test_monitors.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_monitors.cpython-310-pytest-8.2.2.pyc b/test/network/__pycache__/test_monitors.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index 27f2e7ab..00000000 Binary files a/test/network/__pycache__/test_monitors.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_network.cpython-310-pytest-7.4.4.pyc b/test/network/__pycache__/test_network.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index e1e54af9..00000000 Binary files a/test/network/__pycache__/test_network.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_network.cpython-310-pytest-8.1.1.pyc b/test/network/__pycache__/test_network.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index e1e54af9..00000000 Binary files a/test/network/__pycache__/test_network.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_network.cpython-310-pytest-8.2.2.pyc b/test/network/__pycache__/test_network.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index e0082300..00000000 Binary files a/test/network/__pycache__/test_network.cpython-310-pytest-8.2.2.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_nodes.cpython-310-pytest-7.4.4.pyc b/test/network/__pycache__/test_nodes.cpython-310-pytest-7.4.4.pyc deleted file mode 100644 index 41cf3244..00000000 Binary files a/test/network/__pycache__/test_nodes.cpython-310-pytest-7.4.4.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_nodes.cpython-310-pytest-8.1.1.pyc b/test/network/__pycache__/test_nodes.cpython-310-pytest-8.1.1.pyc deleted file mode 100644 index 41cf3244..00000000 Binary files a/test/network/__pycache__/test_nodes.cpython-310-pytest-8.1.1.pyc and /dev/null differ diff --git a/test/network/__pycache__/test_nodes.cpython-310-pytest-8.2.2.pyc b/test/network/__pycache__/test_nodes.cpython-310-pytest-8.2.2.pyc deleted file mode 100644 index 47d90be7..00000000 Binary files a/test/network/__pycache__/test_nodes.cpython-310-pytest-8.2.2.pyc and /dev/null differ