Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Missing Variables in Conv Model #354

Merged
merged 3 commits into from
Sep 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lava/proc/conv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class AbstractPyConvModel(PyLoihiProcessModel):
dilation: np.ndarray = LavaPyType(np.ndarray, np.int8, precision=8)
groups: np.ndarray = LavaPyType(np.ndarray, np.int8, precision=8)
num_message_bits: np.ndarray = LavaPyType(np.ndarray, np.int8, precision=5)
weight_exp: np.ndarray = LavaPyType(np.ndarray, np.int32, precision=8)
mgkwill marked this conversation as resolved.
Show resolved Hide resolved
num_weight_bits: np.ndarray = LavaPyType(np.ndarray, np.int8, precision=5)

def run_spk(self) -> None:
if self.num_message_bits.item() > 0:
Expand Down Expand Up @@ -71,8 +73,6 @@ class PyConvModelFixed(AbstractPyConvModel):
a_out: PyOutPort = LavaPyType(PyOutPort.VEC_DENSE, np.int32, precision=24)
a_buf: np.ndarray = LavaPyType(np.ndarray, np.int32, precision=24)
weight: np.ndarray = LavaPyType(np.ndarray, np.int32, precision=8)
weight_exp: np.ndarray = LavaPyType(np.ndarray, np.int32, precision=8)
num_weight_bits: np.ndarray = LavaPyType(np.ndarray, np.int8, precision=5)

def clamp_precision(self, x: np.ndarray) -> np.ndarray:
return utils.signed_clamp(x, bits=24)