Skip to content

Commit c1a21ce

Browse files
author
Alexander Ororbia
committed
cleanup of components, added leaky-noise-cell, minor edits
1 parent 05e0a7d commit c1a21ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+252
-145
lines changed

ngclearn/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from ngcsimlib.context import Context, ContextObjectTypes
3333
from ngcsimlib import Component
3434
from ngcsimlib.compartment import Compartment
35+
from ngcsimlib.parser import compilable
3536

3637
from ngcsimlib import logger
3738

ngclearn/components/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## point to rate-coded cell component types
44
from .neurons.graded.rateCell import RateCell
5+
from .neurons.graded.leakyNoiseCell import LeakyNoiseCell
56
from .neurons.graded.gaussianErrorCell import GaussianErrorCell
67
from .neurons.graded.laplacianErrorCell import LaplacianErrorCell
78
from .neurons.graded.bernoulliErrorCell import BernoulliErrorCell

ngclearn/components/input_encoders/bernoulliCell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ngclearn.components.jaxComponent import JaxComponent
22
from jax import numpy as jnp, random
3-
from ngcsimlib.compartment import Compartment
4-
from ngcsimlib.parser import compilable
3+
from ngclearn import compilable #from ngcsimlib.parser import compilable
4+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
55
import jax
66
from typing import Union
77

ngclearn/components/input_encoders/latencyCell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from ngclearn.utils.model_utils import clamp_min, clamp_max
88

9-
from ngcsimlib.compartment import Compartment
10-
from ngcsimlib.parser import compilable
9+
from ngclearn import compilable #from ngcsimlib.parser import compilable
10+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
1111

1212
@partial(jit, static_argnums=[5])
1313
def _calc_spike_times_linear(data, tau, thr, first_spk_t, num_steps=1.,

ngclearn/components/input_encoders/phasorCell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from typing import Union
55

66
from ngcsimlib.logger import info, warn
7-
from ngcsimlib.compartment import Compartment
8-
from ngcsimlib.parser import compilable
7+
from ngclearn import compilable #from ngcsimlib.parser import compilable
8+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
99

1010
class PhasorCell(JaxComponent):
1111
"""

ngclearn/components/input_encoders/poissonCell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from typing import Union
55

66
from ngcsimlib import deprecate_args
7-
from ngcsimlib.parser import compilable
8-
from ngcsimlib.compartment import Compartment
7+
from ngclearn import compilable #from ngcsimlib.parser import compilable
8+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
99

1010
class PoissonCell(JaxComponent):
1111
"""

ngclearn/components/neurons/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## point to rate-coded cell componet types
22
from .graded.rateCell import RateCell
3+
from .graded.leakyNoiseCell import LeakyNoiseCell
34
from .graded.gaussianErrorCell import GaussianErrorCell
45
from .graded.laplacianErrorCell import LaplacianErrorCell
56
from .graded.bernoulliErrorCell import BernoulliErrorCell

ngclearn/components/neurons/graded/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## point to rate-coded cell componet types
1+
## point to rate-coded cell component types
22
from .rateCell import RateCell
3+
from .leakyNoiseCell import LeakyNoiseCell
34
from .gaussianErrorCell import GaussianErrorCell
45
from .laplacianErrorCell import LaplacianErrorCell
56
from .bernoulliErrorCell import BernoulliErrorCell

ngclearn/components/neurons/graded/bernoulliErrorCell.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
from ngclearn.components.jaxComponent import JaxComponent
44
from jax import numpy as jnp, jit
5-
from ngclearn.utils import tensorstats
65
from ngclearn.utils.model_utils import sigmoid, d_sigmoid
76

8-
from ngcsimlib.logger import info
9-
from ngcsimlib.compartment import Compartment
10-
from ngcsimlib.parser import compilable
7+
from ngclearn import compilable #from ngcsimlib.parser import compilable
8+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
119

1210
class BernoulliErrorCell(JaxComponent): ## Rate-coded/real-valued error unit/cell
1311
"""

ngclearn/components/neurons/graded/gaussianErrorCell.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
from ngclearn.components.jaxComponent import JaxComponent
44
from jax import numpy as jnp, jit
5-
from ngclearn.utils import tensorstats
6-
7-
from ngcsimlib.logger import info
8-
from ngcsimlib.compartment import Compartment
9-
from ngcsimlib.parser import compilable
5+
from ngclearn import compilable #from ngcsimlib.parser import compilable
6+
from ngclearn import Compartment #from ngcsimlib.compartment import Compartment
107

118
class GaussianErrorCell(JaxComponent): ## Rate-coded/real-valued error unit/cell
129
"""

0 commit comments

Comments
 (0)