This commit is contained in:
2023-05-17 22:41:09 +07:00
parent e47ab2a855
commit 9539b1b39b
4 changed files with 27 additions and 26 deletions

View File

@@ -123,7 +123,7 @@ function resetLearningParams!(n::alifNeuron)
# reset refractory state at the start/end of episode. Otherwise once neuron goes into
# refractory state, it will stay in refractory state forever
reset_refractoryCounter!(n)
# reset_refractoryCounter!(n)
end
# function reset_learning_no_wchange!(n::passthroughNeuron)
@@ -136,12 +136,12 @@ end
function resetLearningParams!(n::linearNeuron)
reset_epsilonRec!(n)
reset_wRecChange!(n)
reset_v_t!(n)
# reset_v_t!(n)
reset_firing_counter!(n)
# reset refractory state at the start/end of episode. Otherwise once neuron goes into
# refractory state, it will stay in refractory state forever
reset_refractoryCounter!(n)
# reset_refractoryCounter!(n)
end
#------------------------------------------------------------------------------------------------100
@@ -279,7 +279,8 @@ end
function synapticConnStrength!(n::Union{computeNeuron, outputNeuron})
for (i, connStrength) in enumerate(n.synapticStrength)
# check whether connStrength increase or decrease based on usage from n.epsilonRec
updown = n.epsilonRec[i] == 0.0 ? "down" : "up"
#WORKING n.epsilonRec is all 0.0 why? may b it was reset?
updown = n.epsilonRec[i] == 0.0 ? "down" : "up"
updatedConnStrength = synapticConnStrength(connStrength, updown)
updatedConnStrength = GeneralUtils.limitvalue(updatedConnStrength,
n.synapticStrengthLimit.lowerlimit, n.synapticStrengthLimit.upperlimit)
@@ -321,7 +322,7 @@ end
within its radius. radius must be odd number
"""
function normalizePeak!(v::Vector, radius::Integer=2)
peak = findall(isequal.(v, maximum(abs.(v))))[1]
peak = findall(isequal.(abs.(v), maximum(abs.(v))))[1]
upindex = peak - radius
upindex = upindex < 1 ? 1 : upindex
downindex = peak + radius