synaptic connection strength concept

This commit is contained in:
2023-05-17 07:33:03 +07:00
parent b9a140372d
commit dee756adac
4 changed files with 19 additions and 26 deletions

View File

@@ -65,7 +65,7 @@ function learn!(kfn::kfn_1, correctAnswer::AbstractVector)
outs = [n.z_t1 for n in kfn.outputNeuronsArray]
for (i, out) in enumerate(outs)
if out != correctAnswer[i] # need to adjust weight
kfnError = (kfn.outputNeuronsArray[i].v_th - kfn.outputNeuronsArray[i].v_t) *
kfnError = (kfn.outputNeuronsArray[i].v_th - kfn.outputNeuronsArray[i].v_t1) *
100 / kfn.outputNeuronsArray[i].v_th
# Threads.@threads for n in kfn.neuronsArray
@@ -87,15 +87,9 @@ function learn!(kfn::kfn_1, correctAnswer::AbstractVector)
LinearAlgebra.normalize!(n.wRec, 1)
n.wRec .*= nonFlipedSign # set weight that fliped sign to 0 for random new connection
# Threads.@threads for n in kfn.neuronsArray
for n in kfn.neuronsArray
#WORKING synapticConnStrength
#TODO neuroplasticity
end
synapticConnStrength!(n)
#TODO neuroplasticity
println("")
end
for n in kfn.outputNeuronsArray # merge wRecChange into wRec
@@ -105,7 +99,7 @@ function learn!(kfn::kfn_1, correctAnswer::AbstractVector)
LinearAlgebra.normalize!(n.wRec, 1)
n.wRec .*= nonFlipedSign # set weight that fliped sign to 0 for random new connection
#TODO synapticConnStrength
synapticConnStrength!(n)
#TODO neuroplasticity
end