This commit is contained in:
2023-05-17 17:21:32 +07:00
parent a114935b2d
commit 6857c249da
4 changed files with 23 additions and 23 deletions

View File

@@ -244,9 +244,10 @@ function kfn_1(kfnParams::Dict)
# add ExInType into each computeNeuron subExInType
for n in reverse(kfn.neuronsArray)
try # input neuron doest have n.subscriptionList
for sub_id in n.subscriptionList
for (i, sub_id) in enumerate(n.subscriptionList)
n_ExInType = kfn.neuronsArray[sub_id].ExInType
push!(n.subExInType, n_ExInType)
# push!(n.subExInType, n_ExInType)
n.wRec[i] *= n_ExInType
end
catch
end
@@ -255,9 +256,10 @@ function kfn_1(kfnParams::Dict)
# add ExInType into each output neuron subExInType
for n in kfn.outputNeuronsArray
try # input neuron doest have n.subscriptionList
for sub_id in n.subscriptionList
for (i, sub_id) in enumerate(n.subscriptionList)
n_ExInType = kfn.neuronsArray[sub_id].ExInType
push!(n.subExInType, n_ExInType)
# push!(n.subExInType, n_ExInType)
n.wRec[i] *= n_ExInType
end
catch
end
@@ -306,7 +308,7 @@ Base.@kwdef mutable struct lifNeuron <: computeNeuron
ExInType::Integer = 1 # 1 excitatory, -1 inhabitory
knowledgeFnName::Union{String,Nothing} = nothing # knowledgeFn that this neuron belongs to
subscriptionList::Union{Array{Int64},Nothing} = nothing # list of other neuron that this neuron synapse subscribed to
subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
# subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
timeStep::Number = 0.0 # current time
wRec::Union{Array{Float64},Nothing} = nothing # synaptic weight (for receiving signal from other neuron)
v_t::Float64 = 0.0 # vᵗ, postsynaptic neuron membrane potential of previous timestep
@@ -397,7 +399,7 @@ Base.@kwdef mutable struct alifNeuron <: computeNeuron
ExInType::Integer = -1 # 1 excitatory, -1 inhabitory
knowledgeFnName::Union{String,Nothing} = nothing # knowledgeFn that this neuron belongs to
subscriptionList::Union{Array{Int64},Nothing} = nothing # list of other neuron that this neuron synapse subscribed to
subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
# subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
timeStep::Union{Number,Nothing} = nothing # current time
wRec::Union{Array{Float64},Nothing} = nothing # synaptic weight (for receiving signal from other neuron)
v_t::Float64 = 0.0 # vᵗ, postsynaptic neuron membrane potential of previous timestep
@@ -504,7 +506,7 @@ Base.@kwdef mutable struct linearNeuron <: outputNeuron
knowledgeFnName::Union{String,Nothing} = nothing # knowledgeFn that this neuron belongs to
subscriptionList::Union{Array{Int64},Nothing} = nothing # list of other neuron that this neuron synapse subscribed to
timeStep::Union{Number,Nothing} = nothing # current time
subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
# subExInType::Array{Int64} = Vector{Int64}() # store ExIn type of subscribed neurons
wRec::Union{Array{Float64},Nothing} = nothing # synaptic weight (for receiving signal from other neuron)
v_t::Float64 = 0.0 # vᵗ, postsynaptic neuron membrane potential of previous timestep
v_t1::Float64 = rand() # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep