From 990ea86e7eabb6aa5810f33bba0be118d414ad9f Mon Sep 17 00:00:00 2001 From: Saranraj Nambusubramaniyan Date: Mon, 16 May 2022 09:52:11 +0200 Subject: [PATCH] util func update --- sorn/sorn.py | 4 ++-- sorn/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sorn/sorn.py b/sorn/sorn.py index bdfbacf..84b6103 100644 --- a/sorn/sorn.py +++ b/sorn/sorn.py @@ -304,11 +304,11 @@ def structural_plasticity(wee: np.array): # Do structural plasticity # Choose the smallest weights randomly from the weight matrix wee - indexes = Initializer.get_unconnected_indexes(wee) + indices = Initializer.inactive_synapses(wee) # Choose any idx randomly such that i!=j while True: - idx_rand = random.choice(indexes) + idx_rand = random.choice(indices) if idx_rand[0] != idx_rand[1]: break diff --git a/sorn/utils.py b/sorn/utils.py index f9d49b3..dfc4f9b 100644 --- a/sorn/utils.py +++ b/sorn/utils.py @@ -366,7 +366,7 @@ def reset_max(z: np.array, cutoff_val: float): return z @staticmethod - def get_unconnected_indexes(wee: np.array): + def inactive_synapses(wee: np.array): """Helper function for Structural plasticity to randomly select the unconnected units Args: