add Random
This commit is contained in:
44
src/type.jl
44
src/type.jl
@@ -2,7 +2,7 @@ module type
|
||||
|
||||
# export
|
||||
|
||||
using CUDA
|
||||
using CUDA, Random
|
||||
|
||||
#------------------------------------------------------------------------------------------------100
|
||||
|
||||
@@ -18,10 +18,48 @@ Base.@kwdef mutable struct kfn <: knowledgeFn
|
||||
params::Dict = Dict() # store params of knowledgeFn itself for later use
|
||||
timeStep::AbstractArray = [0]
|
||||
refractory::Union{AbstractArray, Nothing} = nothing
|
||||
z_i_t1::Union{AbstractArray, Nothing} = nothing # 2D activation matrix
|
||||
z_i_t::Union{AbstractArray, Nothing} = nothing
|
||||
z_t2::Union{AbstractArray, Nothing} = nothing
|
||||
z_t::Union{AbstractArray, Nothing} = nothing
|
||||
z_t1::Union{AbstractArray, Nothing} = nothing
|
||||
end
|
||||
|
||||
function kfn(kfnParams::Dict)
|
||||
kfn = kfn()
|
||||
kfn.kfnParams = kfnParams
|
||||
kfn.knowledgeFnName = kfn.kfnParams[:knowledgeFnName]
|
||||
|
||||
if kfn.kfnParams[:computeNeuronNumber] < kfn.kfnParams[:totalInputPort]
|
||||
throw(error("number of compute neuron must be greater than input neuron"))
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
error("debug end")
|
||||
end
|
||||
|
||||
|
||||
@@ -80,8 +118,6 @@ end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user