Skip to content

Commit

Permalink
fix input models in brainpy.dyn (#172)
Browse files Browse the repository at this point in the history
fix input models in brainpy.dyn
  • Loading branch information
chaoming0625 authored Apr 20, 2022
2 parents 23bba33 + 92a2174 commit 31a1072
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions brainpy/dyn/neurons/input_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def __init__(
self.num_times = len(times)

# data about times and indices
self.i = bm.Variable(jnp.zeros(1, dtype=bm.int_))
self.times = bm.Variable(jnp.asarray(times, dtype=bm.float_))
self.indices = bm.Variable(jnp.asarray(indices, dtype=bm.int_))
self.spike = bm.Variable(jnp.zeros(self.num, dtype=bool))
self.i = bm.Variable(bm.zeros(1, dtype=bm.int_))
self.times = bm.Variable(bm.asarray(times, dtype=bm.float_))
self.indices = bm.Variable(bm.asarray(indices, dtype=bm.int_))
self.spike = bm.Variable(bm.zeros(self.num, dtype=bool))
if need_sort:
sort_idx = bm.argsort(self.times)
self.indices.value = self.indices[sort_idx]
Expand Down Expand Up @@ -121,8 +121,8 @@ def __init__(
self.freqs = init_param(freqs, self.num, allow_none=False)
self.dt = bm.get_dt() / 1000.
self.size = (size,) if isinstance(size, int) else tuple(size)
self.spike = bm.Variable(jnp.zeros(self.num, dtype=bool))
self.t_last_spike = bm.Variable(jnp.ones(self.num) * -1e7)
self.spike = bm.Variable(bm.zeros(self.num, dtype=bool))
self.t_last_spike = bm.Variable(bm.ones(self.num) * -1e7)
self.rng = bm.random.RandomState(seed=seed)

def update(self, _t, _i):
Expand Down

0 comments on commit 31a1072

Please sign in to comment.