Skip to content

Commit bdb0ce2

Browse files
author
Alexander Ororbia
committed
made revisions to components/clean-up; added back in deprecators
1 parent e0c75fa commit bdb0ce2

33 files changed

+45
-65
lines changed

ngclearn/components/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
from .synapses.modulated.MSTDPETSynapse import MSTDPETSynapse
5656
from .synapses.modulated.REINFORCESynapse import REINFORCESynapse
5757

58-
## point to monitors
59-
from .monitor import Monitor
60-
6158
## point to patched component types
6259
from .synapses.patched.patchedSynapse import PatchedSynapse
6360
from .synapses.patched.staticPatchedSynapse import StaticPatchedSynapse

ngclearn/components/input_encoders/latencyCell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class LatencyCell(JaxComponent):
143143
batch_size: batch size dimension of this cell (Default: 1)
144144
"""
145145

146-
# Define Functions
147146
def __init__(
148147
self, name: str, n_units: int, tau: float = 1., threshold: float = 0.01,
149148
first_spike_time: float = 0., linearize: bool = False,
@@ -261,4 +260,4 @@ def help(cls): ## component help function
261260
X = LatencyCell("X", 9)
262261
print(X)
263262
print(X.calc_spike_times.compiled.code)
264-
print(X.advance_state.compiled.code)
263+
print(X.advance_state.compiled.code)

ngclearn/components/input_encoders/phasorCell.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class PhasorCell(JaxComponent):
3131
batch_size: batch size dimension of this cell (Default: 1)
3232
"""
3333

34-
# Define Functions
3534
def __init__(
3635
self, name, n_units, target_freq=63.75, batch_size=1, disable_phasor=False, **kwargs):
3736
super().__init__(name, **kwargs)

ngclearn/components/jaxComponent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ def __repr__(self):
7070
else:
7171
line = "None"
7272
lines += f" {f'({c})'.ljust(maxlen)}{line}\n"
73-
return lines
73+
return lines
74+

ngclearn/components/neurons/graded/laplacianErrorCell.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class LaplacianErrorCell(JaxComponent): ## Rate-coded/real-valued error unit/cel
3737
to a constant/fixed `scale`
3838
"""
3939

40-
# Define Functions
4140
def __init__(self, name, n_units, batch_size=1, scale=1., shape=None, **kwargs):
4241
super().__init__(name, **kwargs)
4342

ngclearn/components/neurons/graded/rateCell.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ class RateCell(JaxComponent): ## Rate-coded/real-valued cell
160160
resist_scale: a scaling factor applied to incoming pressure `j` (default: 1)
161161
"""
162162

163-
# Define Functions
164163
def __init__(
165164
self, name, n_units, tau_m, prior=("gaussian", 0.), act_fx="identity", output_scale=1., threshold=("none", 0.),
166165
integration_type="euler", batch_size=1, resist_scale=1., shape=None, is_stateful=True, **kwargs):

ngclearn/components/neurons/spiking/IFCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class IFCell(JaxComponent): ## integrate-and-fire cell
8686
the value of `v_rest` (default: True)
8787
"""
8888

89-
#@deprecate_args(thr_jitter=None)
89+
@deprecate_args(thr_jitter=None)
9090
def __init__(
9191
self, name, n_units, tau_m, resist_m=1., thr=-52., v_rest=-65., v_reset=-60., refract_time=0.,
9292
integration_type="euler", surrogate_type="straight_through", lower_clamp_voltage=True, **kwargs

ngclearn/components/neurons/spiking/RAFCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class RAFCell(JaxComponent):
9797
at an increase in computational cost (and simulation time)
9898
"""
9999

100-
#@deprecate_args(resist_m="resist_v", tau_m="tau_v", b="dampen_factor")
100+
@deprecate_args(resist_m="resist_v", tau_m="tau_v", b="dampen_factor")
101101
def __init__(
102102
self, name, n_units, tau_v=1., tau_w=1., thr=1., omega=10., dampen_factor=-1., v_reset=0., w_reset=0.,
103103
v0=0., w0=0., resist_v=1., integration_type="euler", batch_size=1, **kwargs

ngclearn/components/neurons/spiking/WTASCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class WTASCell(JaxComponent): ## winner-take-all spiking cell
5050
thr_jitter: scale of uniform jitter to add to initialization of thresholds
5151
"""
5252

53-
#@deprecate_args(thr_base="thrBase")
53+
@deprecate_args(thrBase="thr_base")
5454
def __init__(
5555
self, name, n_units, tau_m, resist_m=1., thr_base=0.4, thr_gain=0.002, refract_time=0., thr_jitter=0.05,
5656
**kwargs

ngclearn/components/neurons/spiking/adExCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class AdExCell(JaxComponent): ## adaptive exponential integrate-and-fire cell
9494
at an increase in computational cost (and simulation time)
9595
"""
9696

97-
#@deprecate_args(v_thr="thr")
97+
@deprecate_args(v_thr="thr")
9898
def __init__(
9999
self, name, n_units, tau_m=15., resist_m=1., tau_w=400., v_sharpness=2., intrinsic_mem_thr=-55., thr=5.,
100100
v_rest=-72., v_reset=-75., a=0.1, b=0.75, v0=-70., w0=0., integration_type="euler", batch_size=1, **kwargs

0 commit comments

Comments
 (0)