Skip to content

Commit af76edb

Browse files
committed
fix ratecell ug of passing unrelated kwargs to parent class
1 parent c8bf7b5 commit af76edb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ngclearn/components/neurons/graded/rateCell.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ class RateCell(JaxComponent): ## Rate-coded/real-valued cell
161161
def __init__(
162162
self, name, n_units, tau_m, prior=("gaussian", 0.), act_fx="identity", output_scale=1., threshold=("none", 0.),
163163
integration_type="euler", batch_size=1, resist_scale=1., shape=None, is_stateful=True, **kwargs):
164-
super().__init__(name, **kwargs)
164+
jax_comp_kwargs = {k: v for k, v in kwargs.items() if k not in ('omega_0',)}
165+
this_class_kwargs = {k: v for k, v in kwargs.items() if k in ('omega_0',)}
166+
super().__init__(name, **jax_comp_kwargs)
165167

166168
## membrane parameter setup (affects ODE integration)
167169
self.output_scale = output_scale
@@ -200,7 +202,7 @@ def __init__(
200202

201203
omega_0 = None
202204
if act_fx == "sine":
203-
omega_0 = kwargs["omega_0"]
205+
omega_0 = this_class_kwargs["omega_0"]
204206
self.fx, self.dfx = create_function(fun_name=act_fx, args=omega_0)
205207

206208
# compartments (state of the cell & parameters will be updated through stateless calls)

0 commit comments

Comments
 (0)