refractoring
This commit is contained in:
@@ -47,9 +47,9 @@ function (kfn::kfn_1)(m::model, input_data::AbstractVector)
|
||||
end
|
||||
|
||||
# clear variables
|
||||
kfn.firedNeurons = Vector{Int64}()
|
||||
kfn.firedNeurons_t0 = Vector{Bool}()
|
||||
kfn.firedNeurons_t1 = Vector{Bool}()
|
||||
kfn.firedNeurons = Int64[]
|
||||
kfn.firedNeurons_t0 = Bool[]
|
||||
kfn.firedNeurons_t1 = Bool[]
|
||||
|
||||
kfn.learningStage = "learning"
|
||||
m.learningStage = kfn.learningStage
|
||||
|
||||
@@ -421,9 +421,10 @@ function neuroplasticity!(n::outputNeuron, firedNeurons::Vector,
|
||||
|
||||
# add new synaptic connection to neuron
|
||||
for (i, connIndex) in enumerate(zeroWeightConnIndex)
|
||||
if length(nFiredPool) != 0
|
||||
newConn = popfirst!(nFiredPool)
|
||||
else
|
||||
newConn::Int64 = 0
|
||||
try
|
||||
newConn = popfirst!(nFiredPool)
|
||||
catch
|
||||
newConn = popfirst!(nNonFiredPool)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user