refractoring

This commit is contained in:
2023-05-16 23:15:32 +07:00
parent dfecf23884
commit f53adf288d
2 changed files with 29 additions and 11 deletions

View File

@@ -289,13 +289,32 @@ 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, bias::Number=0)
function synapticConnStrength(currentStrength::AbstractFloat, updown::String, bias::Number=0)
currentStrength += bias
updatedStrength - (1.0 - sigmoid(currentStrength))
if currentStrength > 0
Δstrength = (1.0 - sigmoid(currentStrength))
else
Δstrength = sigmoid(currentStrength)
end
if updown == "up"
updatedStrength = currentStrength + Δstrength
else
updatedStrength = currentStrength - Δstrength
end
updatedStrength -= bias
return updatedStrength
end
function synapticConnStrength(n::compute_neuron)
for connStrength in n.synapticStrength
synapticConnStrength
end
@@ -313,8 +332,6 @@ end
end # end module