Skip to content

Commit 2d50141

Browse files
authored
Merge pull request #158 from DavidIkov/origin_master
Fix for missed errors.
2 parents ac6ae3b + 70ab927 commit 2d50141

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

examples/mnist-learn/models/altai/construct_network.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ static void create_projections(
9999
// Synapse creation.
100100
ResourceSynapseParams raster_to_input_synapse;
101101
raster_to_input_synapse.rule_.dopamine_plasticity_period_ = raster_to_input_synapse_dopamine_plasticity_period;
102-
raster_to_input_synapse.rule_.w_min_ = raster_to_input_synapse_w_max;
103-
raster_to_input_synapse.rule_.w_max_ = raster_to_input_synapse_w_min;
102+
raster_to_input_synapse.rule_.w_max_ = raster_to_input_synapse_w_max;
103+
raster_to_input_synapse.rule_.w_min_ = raster_to_input_synapse_w_min;
104104
raster_to_input_synapse.rule_.synaptic_resource_ =
105105
resource_from_weight(0, raster_to_input_synapse.rule_.w_min_, raster_to_input_synapse.rule_.w_max_);
106106
// Creating projection out of synapse.
@@ -114,21 +114,21 @@ static void create_projections(
114114
target_to_input_synapse_dopamine.output_type_ = knp::synapse_traits::OutputType::DOPAMINE;
115115
target_to_input_synapse_dopamine.weight_ = 0.179376 * 1000;
116116
target_to_input_synapse_dopamine.delay_ = 3;
117-
auto target_to_l_proj_dopamine = constructor.add_projection(
117+
auto target_to_input_proj_dopamine = constructor.add_projection(
118118
target_to_input_synapse_dopamine, knp::framework::projection::creators::aligned<DeltaSynapse>, pops.target_pop_,
119119
pops.input_pop_, false, false);
120120
// Marking created projection, labels will go into it.
121-
network.data_.projections_from_classes_.push_back(target_to_l_proj_dopamine);
121+
network.data_.projections_from_classes_.push_back(target_to_input_proj_dopamine);
122122

123123
DeltaSynapseParams target_to_input_synapse_excitatory;
124124
target_to_input_synapse_excitatory.output_type_ = knp::synapse_traits::OutputType::EXCITATORY;
125125
target_to_input_synapse_excitatory.weight_ = -30 * 1000;
126126
target_to_input_synapse_excitatory.delay_ = 4;
127-
auto target_to_l_proj_excitatory = constructor.add_projection(
127+
auto target_to_input_proj_excitatory = constructor.add_projection(
128128
target_to_input_synapse_excitatory, knp::framework::projection::creators::all_to_all<DeltaSynapse>,
129129
pops.target_pop_, pops.input_pop_, false, false);
130130
// Marking created projection, labels will go into it.
131-
network.data_.projections_from_classes_.push_back(target_to_l_proj_excitatory);
131+
network.data_.projections_from_classes_.push_back(target_to_input_proj_excitatory);
132132

133133
DeltaSynapseParams target_to_gate_synapse;
134134
target_to_gate_synapse.output_type_ = knp::synapse_traits::OutputType::EXCITATORY;
@@ -142,11 +142,11 @@ static void create_projections(
142142
DeltaSynapseParams input_to_output_synapse;
143143
input_to_output_synapse.output_type_ = knp::synapse_traits::OutputType::EXCITATORY;
144144
input_to_output_synapse.weight_ = 10.f * 1000;
145-
knp::core::UID l_to_output_proj = constructor.add_projection(
145+
knp::core::UID input_to_output_proj = constructor.add_projection(
146146
input_to_output_synapse, knp::framework::projection::creators::aligned<DeltaSynapse>, pops.input_pop_,
147147
pops.output_pop_, false, true);
148148
// Connecting created projection as receiver to WTA.
149-
network.data_.wta_data_.back().second.push_back(l_to_output_proj);
149+
network.data_.wta_data_.back().second.push_back(input_to_output_proj);
150150

151151
DeltaSynapseParams output_to_gate_synapse;
152152
output_to_gate_synapse.output_type_ = knp::synapse_traits::OutputType::BLOCKING;

examples/mnist-learn/models/altai/hyperparameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ constexpr size_t neurons_per_column = 20;
3535
/// Activation threshold.
3636
constexpr uint16_t activation_threshold = 8531;
3737
/// Potential leak.
38-
constexpr int16_t potential_leak = static_cast<int16_t>(-(1.f - 1.f / 3.f) * 1000);
38+
constexpr int16_t potential_leak = 0;
3939
/// Negative activation threshold.
4040
constexpr uint16_t negative_activation_threshold = 0;
4141
/// Potential reset value.

knp/base-framework/impl/inference_evaluation/classification/processor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ std::vector<InferenceResult> EvaluationHelper::process_inference_predictions() c
9090
for (size_t i = 0; i < predictions_.size(); ++i)
9191
{
9292
auto const &prediction = predictions_[i];
93-
auto const &cur_data = dataset_.get_data_for_inference().first[i];
93+
auto inference_begin = dataset_.get_data_for_inference().first;
94+
auto const &cur_data = inference_begin[i];
9495

9596
if (!prediction.votes_)
9697
++prediction_results[cur_data.first].false_negatives_;

0 commit comments

Comments
 (0)