Skip to content
Snippets Groups Projects
Commit a604a933 authored by Martin Beseda's avatar Martin Beseda
Browse files

ENH: Improved error detection

parent d1ddd66e
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
* @date 13.6.18 -
*/
#include <iostream>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include "NeuralNetwork.h"
......@@ -368,19 +369,19 @@ void NeuralNetwork::set_weight_array(std::vector<double> *weight_ptr) {
void NeuralNetwork::eval_single(std::vector<double> &input, std::vector<double> &output) {
if(!this->in_out_determined && this->n_inputs * this->n_outputs <= 0){
// this->determine_inputs_outputs();
printf("Error: input and output neurons have not been specified\n");
return;
std::cerr << "Input and output neurons have not been specified\n" << std::endl;
exit(-sin1);
}
if(this->n_inputs != input.size()){
printf("Error, input size != Network input size\n");
return;
std::cerr << "Error, input size != Network input size\n" << std::endl;
exit(-1);
}
if(this->n_outputs != output.size()){
printf("Error, output size != Network output size\n");
return;
std::cerr << "Error, output size != Network output size\n" << std::endl;
exit(-1);
}
std::fill(output.begin(), output.end(), 0.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment