Skip to content

Commit

Permalink
Fix clang compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuHernandez committed Nov 4, 2024
1 parent 2b22fbf commit 5bb3d74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/neural_network/NeuralNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ vector<float> NeuralNetwork::calculateError(const vector<float>& outputs, const
vector<float> errors(this->layers.back()->getNumberOfNeurons(), 0);
for (size_t n = 0; n < errors.size(); ++n)
{
if (isnan(desired[n]))
errors[n] = 0;
else
errors[n] = 2 * (desired[n] - outputs[n]);
errors[n] = 2 * (desired[n] - outputs[n]);
}
return errors;
}
Expand Down
2 changes: 1 addition & 1 deletion src/neural_network/layer/Layer.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ float Layer<N>::getAverageOfAbsNeuronWeights() const
auto sum = 0.0f;
for (auto& n : this->neurons)
for (auto w : n.getWeights())
sum += abs(w);
sum += std::abs(w);
sum /= static_cast<float>(this->neurons.size());
return sum;
}
Expand Down
2 changes: 1 addition & 1 deletion src/neural_network/layer/MaxPooling1D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace snn::internal

[[nodiscard]] std::vector<float> computeBackOutput(std::vector<float>& inputErrors) override;
[[nodiscard]] std::vector<float> computeOutput(const std::vector<float>& inputs, bool temporalReset) override;
void computeTrain(std::vector<float> & [[maybe_unused]] inputErrors) override {}
void computeTrain([[maybe_unused]] std::vector<float> & inputErrors) override {}
void buildKernelIndexes() override;

public:
Expand Down

0 comments on commit 5bb3d74

Please sign in to comment.