Skip to content

Commit

Permalink
tests for process and model added; copyright notes added; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jlubo committed Mar 28, 2024
1 parent 12d5b9e commit 550f782
Show file tree
Hide file tree
Showing 7 changed files with 751 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/lava/proc/atrlif/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021-23 Intel Corporation
# Copyright (C) 2023-24 Jannik Luboeinski
# SPDX-License-Identifier: BSD-3-Clause
# See: https://spdx.org/licenses/

import numpy as np
from lava.magma.core.sync.protocols.loihi_protocol import LoihiProtocol
from lava.magma.core.model.py.ports import PyInPort, PyOutPort
Expand Down Expand Up @@ -38,7 +43,6 @@ class PyATRLIFModelFloat(PyLoihiProcessModel):

def __init__(self, proc_params):
super(PyATRLIFModelFloat, self).__init__(proc_params)
print("PyATRLIFModelFloat initialized")

def subthr_dynamics(self, activation_in: np.ndarray):
"""
Expand Down Expand Up @@ -78,9 +82,8 @@ def run_spk(self):
# Perform the sub-threshold and spike computations
self.subthr_dynamics(activation_in=a_in_data)
self.s[:] = (self.v - self.r) >= self.theta
self.s_out_buff = self.s
self.post_spike(spike_vector=self.s_out_buff)
self.s_out.send(self.s_out_buff)
self.post_spike(spike_vector=self.s)
self.s_out.send(self.s)


@implements(proc=ATRLIF, protocol=LoihiProtocol)
Expand Down Expand Up @@ -110,7 +113,6 @@ class PyATRLIFModelFixed(PyLoihiProcessModel):

def __init__(self, proc_params):
super(PyATRLIFModelFixed, self).__init__(proc_params)
print("PyATRLIFModelFixed initialized")

# The `ds_offset` constant enables setting decay constant values to
# exact 4096 = 2**12. Without it, the range of 12-bit unsigned
Expand Down Expand Up @@ -261,6 +263,5 @@ def run_spk(self):
# Perform the sub-threshold and spike computations
self.subthr_dynamics(activation_in=a_in_data)
self.s[:] = (self.v - self.r) >= self.theta
self.s_out_buff = self.s
self.post_spike(spike_vector=self.s_out_buff)
self.s_out.send(self.s_out_buff)
self.post_spike(spike_vector=self.s)
self.s_out.send(self.s)
5 changes: 5 additions & 0 deletions src/lava/proc/atrlif/process.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2022-23 Intel Corporation
# Copyright (C) 2023-24 Jannik Luboeinski
# SPDX-License-Identifier: BSD-3-Clause
# See: https://spdx.org/licenses/

import numpy as np
import typing as ty

Expand Down
Empty file.
Loading

0 comments on commit 550f782

Please sign in to comment.