This commit is contained in:
2023-05-11 10:32:49 +07:00
parent 7c4a0dfa6f
commit c6055dcb86
4 changed files with 45 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
module snn_utils
using Flux.Optimise: apply!
export calculate_α, calculate_ρ, calculate_k, timestep_forward!, init_neuron, no_negative,
export calculate_α, calculate_ρ, calculate_k, timestep_forward!, init_neuron, no_negative!,
precision, calculate_w_change!, store_knowledgefn_error!, interneurons_adjustment!,
reset_z_t!, reset_learning_params!, reset_learning_history_params!,
cal_v_reg!, calculate_w_change_end!,
@@ -28,7 +28,7 @@ function timestep_forward!(x::linear_neuron)
x.out_t = x.out_t1
end
no_negative(n) = n < 0.0 ? 0.0 : x
no_negative!(x) = x < 0.0 ? 0.0 : x
precision(x::Array{<:Array}) = ( std(mean.(x)) / mean(mean.(x)) ) * 100
# reset functions for LIF/ALIF neuron