dev
This commit is contained in:
28
src/learn.jl
28
src/learn.jl
@@ -287,7 +287,7 @@ function learn!(kfn::kfn_1, progress, device=cpu)
|
|||||||
println("on_synapticActivityCounter 0 ", kfn.on_synapticActivityCounter[:,:,1])
|
println("on_synapticActivityCounter 0 ", kfn.on_synapticActivityCounter[:,:,1])
|
||||||
println("on_synapticActivityCounter 5 ", kfn.on_synapticActivityCounter[:,:,6])
|
println("on_synapticActivityCounter 5 ", kfn.on_synapticActivityCounter[:,:,6])
|
||||||
println("wOut 0 ", sum(kfn.on_wOut[:,:,1,1], dims=3))
|
println("wOut 0 ", sum(kfn.on_wOut[:,:,1,1], dims=3))
|
||||||
println("wOut 5 ", sum(kfn.on_wOut[:,:,1,1], dims=3))
|
println("wOut 5 ", sum(kfn.on_wOut[:,:,6,1], dims=3))
|
||||||
end
|
end
|
||||||
|
|
||||||
#WORKING compare output neuron 0 synapse activity when input are label 0 and 5, (!isequal).(wOut)
|
#WORKING compare output neuron 0 synapse activity when input are label 0 and 5, (!isequal).(wOut)
|
||||||
@@ -479,7 +479,7 @@ function neuroplasticity(synapseConnectionNumber,
|
|||||||
#TODO I may need to do something with neuronInactivityCounter and other variables
|
#TODO I may need to do something with neuronInactivityCounter and other variables
|
||||||
wRecChange .= 0
|
wRecChange .= 0
|
||||||
# error("DEBUG -> neuroplasticity")
|
# error("DEBUG -> neuroplasticity")
|
||||||
elseif progress != 0 # progress increase
|
elseif progress == 1 # some progress whether up or down
|
||||||
# ready to reconnect synapse must not have wRecChange
|
# ready to reconnect synapse must not have wRecChange
|
||||||
mask = (!isequal).(wRec, 0)
|
mask = (!isequal).(wRec, 0)
|
||||||
wRecChange .*= mask
|
wRecChange .*= mask
|
||||||
@@ -501,8 +501,7 @@ function neuroplasticity(synapseConnectionNumber,
|
|||||||
synapseReconnectDelay, synapseConnectionNumber, zitCumulative)
|
synapseReconnectDelay, synapseConnectionNumber, zitCumulative)
|
||||||
# error("DEBUG -> neuroplasticity 1")
|
# error("DEBUG -> neuroplasticity 1")
|
||||||
elseif progress == 0 # no progress, no weight update, only rewire
|
elseif progress == 0 # no progress, no weight update, only rewire
|
||||||
# #TESTING -w all non-fire connection except mature connection
|
wRecChange .= 0
|
||||||
# weakenNotMatureSynapse!(wRec, synapticActivityCounter, eta)
|
|
||||||
|
|
||||||
# prune weak synapse
|
# prune weak synapse
|
||||||
pruneSynapse!(wRec, synapticActivityCounter, synapseReconnectDelay)
|
pruneSynapse!(wRec, synapticActivityCounter, synapseReconnectDelay)
|
||||||
@@ -512,6 +511,27 @@ function neuroplasticity(synapseConnectionNumber,
|
|||||||
synapseReconnectDelay, synapseConnectionNumber, zitCumulative)
|
synapseReconnectDelay, synapseConnectionNumber, zitCumulative)
|
||||||
|
|
||||||
# error("DEBUG -> neuroplasticity")
|
# error("DEBUG -> neuroplasticity")
|
||||||
|
elseif progress == -1 # some progress whether up or down
|
||||||
|
# ready to reconnect synapse must not have wRecChange
|
||||||
|
mask = (!isequal).(wRec, 0)
|
||||||
|
wRecChange .*= mask
|
||||||
|
|
||||||
|
# merge learning weight, all resulting negative wRec will get pruned
|
||||||
|
mergeLearnWeight!(wRec, exInType, wRecChange, synapticActivityCounter, synapseReconnectDelay)
|
||||||
|
|
||||||
|
# adjust wRec based on repeatition (90% +w, 10% -w)
|
||||||
|
growRepeatedPath!(wRec, synapticActivityCounter, eta)
|
||||||
|
|
||||||
|
# -w all non-fire connection except mature connection
|
||||||
|
weakenNotMatureSynapse!(wRec, synapticActivityCounter, eta)
|
||||||
|
|
||||||
|
# prune weak synapse
|
||||||
|
pruneSynapse!(wRec, synapticActivityCounter, synapseReconnectDelay)
|
||||||
|
|
||||||
|
# rewire synapse connection
|
||||||
|
rewireSynapse!(wRec, neuronInactivityCounter, synapticActivityCounter,
|
||||||
|
synapseReconnectDelay, synapseConnectionNumber, zitCumulative)
|
||||||
|
# error("DEBUG -> neuroplasticity 1")
|
||||||
else
|
else
|
||||||
error("undefined condition line $(@__LINE__)")
|
error("undefined condition line $(@__LINE__)")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user