refractoring

This commit is contained in:
2023-05-17 12:08:04 +07:00
parent b5c372d570
commit b7c674916e
4 changed files with 8 additions and 10 deletions

View File

@@ -36,8 +36,6 @@ Base.@kwdef mutable struct model <: Ironpen
reset epsilon_j.
"reflect" = neuron will merge wRecChange into wRec then reset wRecChange. """
learningStage::String = "inference"
softreset::Bool = false
timeStep::Number = 0.0
end
""" Model outer constructor
@@ -106,7 +104,6 @@ Base.@kwdef mutable struct kfn_1 <: knowledgeFn
learningStage::String = "inference"
error::Union{Float64,Nothing} = nothing
softreset::Bool = false
firedNeurons::Array{Int64} = Vector{Int64}() # store unique id of firing neurons to be used when random neuron connection
firedNeurons_t0::Union{Vector{Bool},Nothing} = nothing # store firing state of all neurons at t0
@@ -314,7 +311,7 @@ Base.@kwdef mutable struct lif_neuron <: compute_neuron
timeStep::Number = 0.0 # current time
wRec::Union{Array{Float64},Nothing} = nothing # synaptic weight (for receiving signal from other neuron)
v_t::Float64 = rand() # vᵗ, postsynaptic neuron membrane potential of previous timestep
v_t1::Float64 = 0.0 # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t1::Float64 = rand() # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t_default::Union{Float64,Nothing} = 0.0 # default membrane potential voltage
v_th::Float64 = 1.0 # vᵗʰ, neuron firing threshold
vRest::Float64 = 0.0 # resting potential after neuron fired
@@ -407,7 +404,7 @@ Base.@kwdef mutable struct alif_neuron <: compute_neuron
timeStep::Union{Number,Nothing} = nothing # current time
wRec::Union{Array{Float64},Nothing} = nothing # synaptic weight (for receiving signal from other neuron)
v_t::Float64 = rand() # vᵗ, postsynaptic neuron membrane potential of previous timestep
v_t1::Float64 = 0.0 # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t1::Float64 = rand() # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t_default::Union{Float64,Nothing} = 0.0
v_th::Float64 = 1.0 # vᵗʰ, neuron firing threshold
vRest::Float64 = 0.0 # resting potential after neuron fired
@@ -515,7 +512,7 @@ Base.@kwdef mutable struct linear_neuron <: output_neuron
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 = 0.0 # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t1::Float64 = rand() # vᵗ⁺¹, postsynaptic neuron membrane potential at current timestep
v_t_default::Union{Float64,Nothing} = 0.0 # default membrane potential voltage
v_th::Float64 = 1.0 # vᵗʰ, neuron firing threshold
vRest::Float64 = 0.0 # resting potential after neuron fired