add neuroplasticity

This commit is contained in:
2023-05-19 14:54:12 +07:00
parent fb458a49db
commit e6a3ad5202
4 changed files with 110 additions and 59 deletions

View File

@@ -54,8 +54,7 @@ function learn!(kfn::kfn_1, correctAnswer::AbstractVector)
n.wRec .*= nonFlipedSign
synapticConnStrength!(n)
#TODO neuroplasticity
println("")
neuroplasticity!(n, kfn.firedNeurons, kfn.nExInType)
end
end
@@ -68,17 +67,9 @@ function learn!(kfn::kfn_1, correctAnswer::AbstractVector)
n.wRec .*= nonFlipedSign # set weight that fliped sign to 0 for random new connection
synapticConnStrength!(n)
#TODO neuroplasticity
neuroplasticity!(n, kfn.firedNeurons, kfn.nExInType)
end
resetLearningParams!(n)
# clear variables
kfn.firedNeurons = Vector{Int64}()
kfn.firedNeurons_t0 = Vector{Bool}()
kfn.firedNeurons_t1 = Vector{Bool}()
kfn.learningStage = "inference"
end
end