version 0.0.6

This commit is contained in:
ton
2023-08-27 08:32:07 +07:00
parent 9b67a69612
commit 2f89905dc9
13 changed files with 3948 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ using .interface
#------------------------------------------------------------------------------------------------100
""" version 0.0.5
""" version 0.0.6
Todo:
[] add weight liquidity
[DONE] add excitatory/inhabitory matrix

View File

@@ -291,8 +291,10 @@ function lifForward( zit,
# count synaptic inactivity
if !iszero(wRec[i1,i2,i3,i4]) # check if this is wRec subscription
if !iszero(zit[i1,i2,i3,i4]) # synapse is active, reset counter
synapticInactivityCounter[i1,i2,i3,i4] += 1
#WORKING should be function based. range +1.0 to +0.1
synapticInactivityCounter[i1,i2,i3,i4] += 1
else # synapse is inactive, counting
#WORKING should be function based. range +1.0 to +0.01
synapticInactivityCounter[i1,i2,i3,i4] -= 1
end
end

View File

@@ -310,7 +310,8 @@ function lifLearn(wRec,
#WORKING - synapticInactivityCounter -10000 to 10000, weight change liquidity range from 1.0 to 0.1 respectively
# merge learning weight with average learning weight of all batch
wRec .+= (sum(wRecChange, dims=4) ./ (size(wRec, 4))) .* arrayProjection4d
wch = sum(wRecChange, dims=4) ./ (size(wRec, 4)) .* arrayProjection4d
wRec .+= wch
arrayProjection4d_cpu = arrayProjection4d |> cpu
wRec_cpu = wRec |> cpu
@@ -362,7 +363,8 @@ function alifLearn(wRec,
#WORKING - synapticInactivityCounter -10000 to 10000, weight change liquidity range from 1.0 to 0.1 respectively
# merge learning weight with average learning weight of all batch
wRec .+= (sum(wRecChange, dims=4) ./ (size(wRec, 4))) .* arrayProjection4d
wch = sum(wRecChange, dims=4) ./ (size(wRec, 4)) .* arrayProjection4d
wRec .+= wch
arrayProjection4d_cpu = arrayProjection4d |> cpu
wRec_cpu = wRec |> cpu
@@ -484,10 +486,18 @@ function neuroplasticity(synapticConnectionNumber,
return wRec
end
# learningLiquidity(x) = -0.0001x + 1 # -10000 to +10000; f(x) = -5e-05x+0.5
function learningLiquidity(x)
if x > 10000
y = 0.0
elseif x < -10000
y = 1.0
else
y = -5e-05x+0.5 # range -10000 to +10000
end
return y
end

View File

@@ -375,7 +375,8 @@ function wRec(row, col, n, synapticConnectionNumber)
end
end
# 10% of neuron connection should be enough to start to make neuron fires
# adjust weight so that RSNN fires small amount of neurons at the beginning to avoid overwhelming
# all-fire situation. it also better than not-fire-at-all situation.
avgWeight = sum(w)/length(w)
w = w .* (0.01 / avgWeight) # adjust overall weight