refractoring

This commit is contained in:
2023-05-22 20:10:10 +07:00
parent 666e29ffc2
commit b9550a348a
5 changed files with 116 additions and 121 deletions

View File

@@ -260,7 +260,7 @@ end
one may use bias = -5 to transform synaptic strength into range -5 to 5
the return value is shifted back to original scale
"""
function synapticConnStrength(currentStrength::AbstractFloat, updown::String, bias::Number=0)
function synapticConnStrength(currentStrength::AbstractFloat, updown::String, bias::Number=0)::Float64
currentStrength += bias
if currentStrength > 0
Δstrength = (1.0 - sigmoid(currentStrength))
@@ -274,7 +274,7 @@ function synapticConnStrength(currentStrength::AbstractFloat, updown::String, bi
updatedStrength = currentStrength - Δstrength
end
updatedStrength -= bias
return updatedStrength
return updatedStrength
end
""" Compute all synaptic connection strength of a neuron. Also mark n.wRec to 0 if wRec goes