adding kfn

This commit is contained in:
ton
2023-07-06 17:20:46 +07:00
parent c08b821a29
commit d427875679
3 changed files with 49 additions and 34 deletions

View File

@@ -11,7 +11,7 @@ include("type.jl")
using .type # bring model into this module namespace (this module is a parent module) using .type # bring model into this module namespace (this module is a parent module)
include("snnUtils.jl") include("snnUtils.jl")
using .snn_utils using .snnUtils
include("interface.jl") include("interface.jl")
using .interface using .interface
@@ -39,4 +39,42 @@ using .interface
""" """
end # module IronpenGPU end # module IronpenGPU

View File

@@ -3,7 +3,7 @@ module interface
# export # export
using Flux, CUDA # using Flux, CUDA
#------------------------------------------------------------------------------------------------100 #------------------------------------------------------------------------------------------------100

View File

@@ -1,8 +1,12 @@
module type module type
# export export
# struct
kfn
using CUDA, Random # function
using Random
#------------------------------------------------------------------------------------------------100 #------------------------------------------------------------------------------------------------100
@@ -25,40 +29,13 @@ Base.@kwdef mutable struct kfn <: knowledgeFn
end end
function kfn(kfnParams::Dict) function kfn(kfnParams::Dict)
kfn = kfn() kfn_1 = kfn()
kfn.kfnParams = kfnParams kfn_1.params = kfnParams
kfn.knowledgeFnName = kfn.kfnParams[:knowledgeFnName]
if kfn.kfnParams[:computeNeuronNumber] < kfn.kfnParams[:totalInputPort] if kfn_1.params[:computeNeuronNumber] < kfn_1.params[:totalInputPort]
throw(error("number of compute neuron must be greater than input neuron")) throw(error("number of compute neuron must be greater than input neuron"))
end end
error("debug end") error("debug end")
end end