From 85710a0ebfa3f1bb6a2ffb1d366064833bdd9bf1 Mon Sep 17 00:00:00 2001 From: "Artiom N." Date: Wed, 4 Dec 2024 17:14:18 +0300 Subject: [PATCH] ARM build fix: #16 --- .../backends/cpu-library/impl/synaptic_resource_stdp_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/impl/synaptic_resource_stdp_impl.h b/knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/impl/synaptic_resource_stdp_impl.h index df4c4b90..8f160480 100644 --- a/knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/impl/synaptic_resource_stdp_impl.h +++ b/knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/impl/synaptic_resource_stdp_impl.h @@ -275,7 +275,7 @@ void renormalize_resource( continue; } - if (abs(neuron.free_synaptic_resource_) < neuron.synaptic_resource_threshold_) + if (std::fabs(neuron.free_synaptic_resource_) < neuron.synaptic_resource_threshold_) { continue; } @@ -339,7 +339,7 @@ void do_dopamine_plasticity( const double dopamine_constant = 2.0; const double difference = step - neuron.first_isi_spike_ - neuron.isi_max_; neuron.stability_ += neuron.stability_change_parameter_ * neuron.dopamine_value_ * - std::max(dopamine_constant - abs(difference) / neuron.isi_max_, -1.0); + std::max(dopamine_constant - std::fabs(difference) / neuron.isi_max_, -1.0); } recalculate_synapse_weights(synapse_params); }