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