add Random

This commit is contained in:
ton
2023-07-06 12:02:12 +07:00
parent 89e0e6aae9
commit ea004f5f45
4 changed files with 46 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ module IronpenGPU
files and each file can only depend on the file included before it.
"""
include("types.jl")
include("type.jl")
using .types # bring model into this module namespace (this module is a parent module)
include("snnUtils.jl")

View File

@@ -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