This commit is contained in:
ton
2023-07-05 11:19:20 +07:00
parent 4709e18f2d
commit 89e0e6aae9
8 changed files with 1249 additions and 1 deletions

View File

@@ -1,5 +1,42 @@
module IronpenGPU
greet() = print("Hello World!")
# export
""" Order by dependencies of each file. The 1st included file must not depend on any other
files and each file can only depend on the file included before it.
"""
include("types.jl")
using .types # bring model into this module namespace (this module is a parent module)
include("snnUtils.jl")
using .snn_utils
include("interface.jl")
using .interface
#------------------------------------------------------------------------------------------------100
"""
Todo:
[*1] knowledgeFn in GPU format
[] use partial error update for computeNeuron
[] use integrate_neuron_params synapticConnectionPercent = 20%
[2] implement dormant connection and pruning machanism. the longer the training the longer
0 weight stay 0.
[] using RL to control learning signal
[] consider using Dates.now() instead of timestamp because time_stamp may overflow
[] Liquid time constant. training should include adjusting α, neuron membrane potential decay factor
which defined by neuron.tau_m formula in type.jl
Change from version:
-
All features
"""
end # module IronpenGPU

73
src/forward.jl Normal file
View File

@@ -0,0 +1,73 @@
module forward
# export
# using
#------------------------------------------------------------------------------------------------100
end # module

87
src/interface.jl Normal file
View File

@@ -0,0 +1,87 @@
module interface
# export
using Flux, CUDA
#------------------------------------------------------------------------------------------------100
end # module

73
src/learn.jl Normal file
View File

@@ -0,0 +1,73 @@
module learn
# export
# using
#------------------------------------------------------------------------------------------------100
end # module

73
src/snnUtils.jl Normal file
View File

@@ -0,0 +1,73 @@
module snnUtils
# export
# using
#------------------------------------------------------------------------------------------------100
end # module

88
src/type.jl Normal file
View File

@@ -0,0 +1,88 @@
module type
# export
using CUDA
#------------------------------------------------------------------------------------------------100
abstract type Ironpen end
abstract type knowledgeFn <: Ironpen end
rng = MersenneTwister(1234)
#------------------------------------------------------------------------------------------------100
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_t::Union{AbstractArray, Nothing} = nothing
z_t2::Union{AbstractArray, Nothing} = nothing
z_t1::Union{AbstractArray, Nothing} = nothing
end
end # module