Skip to content

Commit

Permalink
util func update
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran-nns committed May 16, 2022
1 parent 0b70f0e commit 990ea86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sorn/sorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sorn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 990ea86

Please # to comment.