fix neuroplasticity error

This commit is contained in:
ton
2023-08-26 18:26:38 +07:00
parent bf78ca5086
commit 9b67a69612
3 changed files with 6 additions and 19 deletions

View File

@@ -370,14 +370,14 @@ function wRec(row, col, n, synapticConnectionNumber)
for slice in eachslice(w, dims=3)
pool = shuffle!([1:row*col...])[1:synapticConnectionNumber]
for i in pool
slice[i] = rand() # assign weight to synaptic connection. /10 to start small,
slice[i] = rand(0.01:0.01:0.1) # assign weight to synaptic connection. /10 to start small,
# otherwise RSNN's vt Usually stay negative (-)
end
end
# 10% of neuron connection should be enough to start to make neuron fires
avgWeight = sum(w)/length(w)
w = w .* (0.1 / avgWeight) # adjust overall weight
w = w .* (0.01 / avgWeight) # adjust overall weight
return w #(row, col, n)
end