From 7ad96f8622b7eebde5af0b2f6002a7aaefb32050 Mon Sep 17 00:00:00 2001 From: tonaerospace Date: Fri, 15 Sep 2023 15:51:15 +0700 Subject: [PATCH] dev --- src/learn.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/learn.jl b/src/learn.jl index 5b5e721..c032035 100644 --- a/src/learn.jl +++ b/src/learn.jl @@ -567,6 +567,7 @@ function onLearn!(wOut, end alltrue(args...) = false ∈ [args...] ? false : true +isbetween(x, lowerlimit, upperlimit) = lowerlimit < x < upperlimit ? true : false #WORKING 1) implement 90% +w, 10% -w 2) rewrite this function function neuroplasticity(synapseConnectionNumber, @@ -609,7 +610,7 @@ function neuroplasticity(synapseConnectionNumber, # -w, synapse with less than 10% of avg activity get reduced weight by eta mask_less = isless.(synapticActivityCounter, lowerlimit) # 1st criteria - + mask_3 = alltrue.(mask_activeSynapse, mask_less) mask_3 .*= 1 .- eta # minor activity synapse weight will be reduced by eta wRec .*= mask_3 @@ -622,6 +623,7 @@ function neuroplasticity(synapseConnectionNumber, # prune weak connection # mark weak / negative synaptic connection so they will get randomed in neuroplasticity() + mask = isbetween.(wRec, 0.0, 0.01) wRec = GeneralUtils.replaceBetween.(wRec, 0.0, 0.01, -1.0) # mark with -1.0 #WORKING rewire synapse connection