Skip to content

Commit

Permalink
Fix pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Kulbach committed Jun 4, 2023
1 parent 46e6296 commit c3da229
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deep_river/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def clone(self, new_params: dict = {}, include_attributes=False):
new_params = new_params or {}
new_params.update(self.kwargs)
new_params.update(self._get_params())
new_params.update({'module': self.module_cls})
new_params.update({"module": self.module_cls})

clone = self.__class__(**new_params)
if include_attributes:
Expand Down
4 changes: 4 additions & 0 deletions deep_river/classification/zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def __init__(
seed: int = 42,
**kwargs,
):
if "module" in kwargs:
del kwargs["module"]
super().__init__(
module=LogisticRegression.LRModule,
loss_fn=loss_fn,
Expand Down Expand Up @@ -217,6 +219,8 @@ def __init__(
):
self.n_width = n_width
self.n_layers = n_layers
if "module" in kwargs:
del kwargs["module"]
super().__init__(
module=MultiLayerPerceptron.MLPModule,
loss_fn=loss_fn,
Expand Down
7 changes: 4 additions & 3 deletions deep_river/regression/zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ class LinearRegression(Regressor):
"""
This class implements a linear regression model in PyTorch.
Parameters
----------
"""

class LRModule(nn.Module):
Expand All @@ -32,6 +29,8 @@ def __init__(
seed: int = 42,
**kwargs,
):
if "module" in kwargs:
del kwargs["module"]
super().__init__(
module=LinearRegression.LRModule,
loss_fn=loss_fn,
Expand Down Expand Up @@ -130,6 +129,8 @@ def __init__(
):
self.n_width = n_width
self.n_layers = n_layers
if "module" in kwargs:
del kwargs["module"]
super().__init__(
module=MultiLayerPerceptron.MLPModule,
loss_fn=loss_fn,
Expand Down

0 comments on commit c3da229

Please sign in to comment.