Commit 69f958f8 authored by Martin Beseda's avatar Martin Beseda

FIX: Fixed unit-tests and compilation

parent 6ed28742
################################################################################
#
# CMake script for finding ExprTk.
# The default CMake search process is used to locate files.
#
# This script creates the following variables:
# EXPRTK_FOUND: Boolean that indicates if the package was found
# EXPRTK_INCLUDE_DIRS: Paths to the necessary header files
#
################################################################################
# Find headers and libraries
FIND_PATH(
EXPRTK_INCLUDE_DIR
NAMES
exprtk.hpp
HINTS
$ENV{EXPRTK_INCLUDE_DIR}
$ENV{EXPRTK_ROOT}
${EXPRTK_ROOT}
PATHS
/usr/local
/usr
/opt/local
PATH_SUFFIXES
include
)
# Set EXPRTK_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
ExprTk
"ExprTk was NOT found!"
EXPRTK_INCLUDE_DIR)
# Output variables
IF(EXPRTK_FOUND)
# Include dirs
SET(EXPRTK_INCLUDE_DIRS ${EXPRTK_INCLUDE_DIR})
ELSE()
MESSAGE(FATAL_ERROR "Set, please, the variable EXPRTK_INCLUDE_DIR to the folder, where 'exprtk.hpp' is located..")
ENDIF(EXPRTK_FOUND)
# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(EXPRTK_INCLUDE_DIR)
include_directories(${EXPRTK_INCLUDE_DIRS})
################################################################################
#
# CMake script for finding ExprTk.
# The default CMake search process is used to locate files.
#
# This script creates the following variables:
# EXPRTK_FOUND: Boolean that indicates if the package was found
# EXPRTK_INCLUDE_DIRS: Paths to the necessary header files
#
################################################################################
# Find headers and libraries
FIND_PATH(
EXPRTK_INCLUDE_DIR
NAMES
exprtk.hpp
HINTS
$ENV{EXPRTK_INCLUDE_DIR}
$ENV{EXPRTK_ROOT}
${EXPRTK_ROOT}
PATHS
/home
/usr/local
/usr
/opt/local
PATH_SUFFIXES
include
)
# Set EXPRTK_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
ExprTk
"ExprTk was NOT found!"
EXPRTK_INCLUDE_DIR)
# Output variables
IF(EXPRTK_FOUND)
# Include dirs
SET(EXPRTK_INCLUDE_DIRS ${EXPRTK_INCLUDE_DIR})
ELSE()
MESSAGE(FATAL_ERROR "Set, please, the variable EXPRTK_INCLUDE_DIR to the folder, where 'exprtk.hpp' is located..")
ENDIF(EXPRTK_FOUND)
# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(EXPRTK_INCLUDE_DIR)
include_directories(${EXPRTK_INCLUDE_DIRS})
#TODO uncomment
#add_subdirectory(tests bin/unit-tests)
add_subdirectory(tests bin/unit-tests)
add_subdirectory(examples bin/examples)
add_library(4neuro SHARED
......@@ -18,9 +17,8 @@ add_library(4neuro SHARED
Solvers/DESolver.cpp
LearningMethods/ILearningMethods.h)
message("Boost_LIBRARIES sadf: ${Boost_LIBRARIES}")
target_link_libraries(4neuro ${Boost_LIBRARIES})
add_library(boost_unit_test SHARED boost_test_lib_dummy.cpp)
add_library(exprtk SHARED exprtk.cpp)
target_link_libraries(4neuro ${Boost_LIBRARIES} boost_unit_test exprtk)
......@@ -2,5 +2,6 @@
// Created by David on 11.07.2018.
//
#define BOOST_TEST_MODULE neuron_test
#define BOOST_TEST_MODULE unit_test
#include <boost/test/included/unit_test.hpp>
//#include<unit_test.hpp>
......@@ -2,70 +2,45 @@
# UNIT TESTS #
##############
<<<<<<< HEAD
add_executable(neuron_test neuron_test.cpp)
target_link_libraries(neuron_test boost_unit_test 4neuro)
=======
#add_executable(neuron_test Neuron_test.cpp)
#target_link_libraries(neuron_test boost_unit_test 4neuro)
>>>>>>> 5fe40bf3d3cae575f15db8b0ad440aa5b558ff1d
target_link_libraries(neuron_test 4neuro)
add_executable(linear_neuron_test NeuronLinear_test.cpp)
target_link_libraries(linear_neuron_test boost_unit_test 4neuro)
target_link_libraries(linear_neuron_test 4neuro)
<<<<<<< HEAD
=======
add_executable(constant_neuron_test NeuronConstant_test.cpp)
target_link_libraries(constant_neuron_test boost_unit_test 4neuro)
target_link_libraries(constant_neuron_test 4neuro)
>>>>>>> 5fe40bf3d3cae575f15db8b0ad440aa5b558ff1d
add_executable(binary_neuron_test NeuronBinary_test.cpp)
target_link_libraries(binary_neuron_test boost_unit_test 4neuro)
target_link_libraries(binary_neuron_test 4neuro)
add_executable(logistic_neuron_test NeuronLogistic_test.cpp)
target_link_libraries(logistic_neuron_test boost_unit_test 4neuro)
target_link_libraries(logistic_neuron_test 4neuro)
<<<<<<< HEAD
add_executable(connection_weight_test ConnectionWeight_test.cpp)
target_link_libraries(connection_weight_test boost_unit_test 4neuro)
add_executable(connection_test Connection_test.cpp)
target_link_libraries(connection_test boost_unit_test 4neuro)
=======
add_executable(connectionFunctionGeneral_test ConnectionFunctionGeneral_test.cpp)
target_link_libraries(connectionFunctionGeneral_test boost_unit_test 4neuro)
>>>>>>> 5fe40bf3d3cae575f15db8b0ad440aa5b558ff1d
target_link_libraries(connectionFunctionGeneral_test 4neuro)
add_executable(neural_network_test NeuralNetwork_test.cpp)
target_link_libraries(neural_network_test boost_unit_test 4neuro)
target_link_libraries(neural_network_test 4neuro)
<<<<<<< HEAD
add_executable(connection_weight_identity_test ConnectionWeightIdentity_test.cpp)
target_link_libraries(connection_weight_identity_test boost_unit_test 4neuro)
=======
add_executable(connection_Function_identity_test ConnectionFunctionIdentity_test.cpp)
target_link_libraries(connection_Function_identity_test boost_unit_test 4neuro)
>>>>>>> 5fe40bf3d3cae575f15db8b0ad440aa5b558ff1d
target_link_libraries(connection_Function_identity_test 4neuro)
add_executable(dataset_test DataSet_test.cpp)
target_link_libraries(dataset_test boost_unit_test 4neuro)
target_link_libraries(dataset_test 4neuro)
add_executable(errorfunction_test ErrorFunctions_test.cpp)
target_link_libraries(errorfunction_test boost_unit_test 4neuro)
target_link_libraries(errorfunction_test 4neuro)
add_executable(particle_swarm_test ParticleSwarm_test.cpp)
target_link_libraries(particle_swarm_test boost_unit_test 4neuro)
target_link_libraries(particle_swarm_test 4neuro)
add_executable(particle_test Particle_test.cpp)
target_link_libraries(particle_test boost_unit_test 4neuro)
target_link_libraries(particle_test 4neuro)
add_executable(NeuralNetworkSum_test NeuralNetworkSum_test.cpp)
target_link_libraries(NeuralNetworkSum_test boost_unit_test 4neuro)
target_link_libraries(NeuralNetworkSum_test 4neuro)
<<<<<<< HEAD
=======
add_executable(DESolver_test DESolver_test.cpp)
target_link_libraries(DESolver_test boost_unit_test 4neuro)
target_link_libraries(DESolver_test 4neuro)
>>>>>>> 5fe40bf3d3cae575f15db8b0ad440aa5b558ff1d
/**
* DESCRIPTION OF THE CLASS
*
* @author David Vojtek
* @date 2018
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include "../NetConnection/ConnectionFunctionGeneral.h"
#include "../Neuron/NeuronLinear.h"
#include <iostream>
/**
* Boost testing suite for testing ConnectionFunctionGeneral.h
*/
BOOST_AUTO_TEST_SUITE(Connection_test)
/**
* Test of constructor of Connection
*/
BOOST_AUTO_TEST_CASE(Connection_construction__test) {
BOOST_CHECK_NO_THROW(ConnectionFunctionGeneral *functionGeneral = new ConnectionFunctionGeneral());
std::vector<size_t> param_indices;
param_indices.push_back(0);
std::string paramToFunction = "this do nothing! Why is it here?";
BOOST_CHECK_NO_THROW(ConnectionFunctionGeneral *functionGeneral = new ConnectionFunctionGeneral(param_indices,
paramToFunction));
}
BOOST_AUTO_TEST_CASE(Connection_eval_test) {
ConnectionFunctionGeneral *functionGeneral = new ConnectionFunctionGeneral();
//TODO implementation not finnish yet;
std::vector<double> parameter_space;
BOOST_CHECK_EQUAL(0, functionGeneral->eval(parameter_space));
}
BOOST_AUTO_TEST_CASE(Connection_eval_partial_derivative_test) {
//TODO function not implemented yet
}
BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
/**
* DESCRIPTION OF THE CLASS
*
* @author David Vojtek
* @date 2018
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include "../NetConnection/ConnectionFunctionIdentity.h"
/**
* Boost testing suite for testing ConnectionWeightIdentity.h
*/
BOOST_AUTO_TEST_SUITE(ConnectionWeightIdentity_test)
/**
* Test of correct construction of ConnectionFunctionIdentity
*/
BOOST_AUTO_TEST_CASE(ConnectionWeightIdentity_construction_test) {
std::vector<double> weight_array = {1, 2, 3, 4, 5};
//Test of none exception when creation new instance of ConnectionFunctionIdentity
BOOST_CHECK_NO_THROW(ConnectionFunctionIdentity *CFI = new ConnectionFunctionIdentity() );
BOOST_CHECK_NO_THROW(ConnectionFunctionIdentity *CFI = new ConnectionFunctionIdentity(2) );
}
/**
* Test of eval method
*/
BOOST_AUTO_TEST_CASE(ConnectionWeightIdentity_eval_test) {
ConnectionFunctionIdentity *CFI1 = new ConnectionFunctionIdentity();
ConnectionFunctionIdentity *CFI2 = new ConnectionFunctionIdentity(0);
ConnectionFunctionIdentity *CFI3 = new ConnectionFunctionIdentity(2);
std::vector<double> parameter_space;
parameter_space.push_back(5);
//Test of correct output of eval method
BOOST_CHECK_EQUAL(1, CFI1->eval(parameter_space));
BOOST_CHECK_EQUAL(5, CFI2->eval(parameter_space));
BOOST_CHECK_THROW(CFI3->eval(parameter_space), std::out_of_range);
}
BOOST_AUTO_TEST_SUITE_END()
/**
* DESCRIPTION OF THE CLASS
*
* @author David Vojtek
* @date 2018
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <boost/test/output_test_stream.hpp>
#include "../Solvers/DESolver.h"
/**
* Boost testing suite for testing DESolver.h
*
*/
BOOST_AUTO_TEST_SUITE(DESolver_test)
/**
* Test of MultiIndex construction test
*/
BOOST_AUTO_TEST_CASE(MultiIndex_construction_test) {
BOOST_CHECK_NO_THROW(MultiIndex multiIndex(2));
}
/**
* Test of MultiIndex set_partial_deravitive method
*/
BOOST_AUTO_TEST_CASE(MultiIndex_set_partial_derivative_test) {
MultiIndex multiIndex(2);
BOOST_CHECK_NO_THROW(multiIndex.set_partial_derivative(0, 1));
BOOST_CHECK_NO_THROW(multiIndex.set_partial_derivative(1, 2));
//BOOST_CHECK_THROW(multiIndex.set_partial_derivative(2, 3), std::out_of_range);
}
/**
* Testo of MultiIndex get_partial_derivative_degrees method
*/
BOOST_AUTO_TEST_CASE(MultiIndex_get_partial_derivative_degrees_test) {
MultiIndex multiIndex(2);
multiIndex.set_partial_derivative(0, 1);
multiIndex.set_partial_derivative(1, 2);
BOOST_CHECK_EQUAL(1, multiIndex.get_partial_derivatives_degrees()->at(0));
BOOST_CHECK_EQUAL(2, multiIndex.get_partial_derivatives_degrees()->at(1));
}
/**
* Test of MultiIndex operator< method
*/
BOOST_AUTO_TEST_CASE(MultiIndex_operator_test) {
MultiIndex multiIndex1(1);
multiIndex1.set_partial_derivative(0, 1);
MultiIndex multiIndex2(2);
multiIndex2.set_partial_derivative(0, 1);
multiIndex2.set_partial_derivative(1, 2);
MultiIndex multiIndex3(1);
multiIndex3.set_partial_derivative(0, 2);
BOOST_CHECK(multiIndex1.operator<(multiIndex2));
//BOOST_CHECK_THROW(multiIndex2.operator<(multiIndex1), std::out_of_range);
BOOST_CHECK(!multiIndex1.operator<(multiIndex1));
BOOST_CHECK(multiIndex1.operator<((multiIndex3)));
}
/**
* Test of MultiIndex toString method
*/
BOOST_AUTO_TEST_CASE(MultiIndex_toString_test) {
MultiIndex multiIndex(2);
BOOST_CHECK_EQUAL("0, 0", multiIndex.to_string());
}
/**
* Test of MultiIndex get_degree method
*/
BOOST_AUTO_TEST_CASE(MultiIndex_get_degree_test) {
MultiIndex multiIndex(2);
BOOST_CHECK_EQUAL(0, multiIndex.get_degree());
multiIndex.set_partial_derivative(0, 1);
multiIndex.set_partial_derivative(1, 3);
BOOST_CHECK_EQUAL(4, multiIndex.get_degree());
}
/**
* Test of DESolver construction
*/
BOOST_AUTO_TEST_CASE(DESolver_construction_test) {
BOOST_CHECK_THROW(DESolver(0, 1, 1), std::invalid_argument);
BOOST_CHECK_THROW(DESolver(1, 0, 1), std::invalid_argument);
BOOST_CHECK_THROW(DESolver(1, 1, 0), std::invalid_argument);
BOOST_CHECK_NO_THROW(DESolver deSolver(1, 1, 1));
/*boost::test_tools::output_test_stream output;
{
cout_redirect guard(output.rdbuf());
DESolver deSolver(1,1,1,1);
}
BOOST_CHECK(output.is_equal("Differential Equation Solver with 1 equations\n--------------------------------------------------------------------------\nConstructing NN structure representing the solution [1 input neurons][1 inner neurons][1 output neurons]...\n adding a connection between input neuron 0 and inner neuron 0, weight index 0\n adding a connection between inner neuron 0 and output neuron 0, weight index 1\ndone\n\n"));
*/
}
/**
* Test of DESolver get_solution method
*/
BOOST_AUTO_TEST_CASE(DESolver_get_solution_test) {
DESolver deSolver(1, 1, 1);
MultiIndex *alpha = new MultiIndex(1);
NeuralNetwork *network = deSolver.get_solution(*alpha);
BOOST_CHECK_EQUAL(1, network->get_n_inputs());
BOOST_CHECK_EQUAL(1, network->get_n_outputs());
}
BOOST_AUTO_TEST_SUITE_END()
/**
* DESCRIPTION OF THE CLASS
*
* @author David Vojtek
* @date 2018
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp>
#include "../DataSet/DataSet.h"
#include "stdio.h"
#include <iostream>
//#include <boost/filesystem.hpp>
/**
* Boost testing suite for testing DataSet.h
*/
BOOST_AUTO_TEST_SUITE(DataSet_test)
struct cout_redirect {
cout_redirect(std::streambuf *new_buffer)
: old(std::cout.rdbuf(new_buffer)) {}
~cout_redirect() {
std::cout.rdbuf(old);
}
private:
std::streambuf *old;
};
/**
* Test of DataSet constructor with filepath parameter
*/
BOOST_AUTO_TEST_CASE(DataSet_construction_from_file_test) {
//test of exception with non-existing file path
//TODO resolve exception throw
// DataSet dataSet("file/unknown");
//BOOST_CHECK_THROW(DataSet dataSet("file unknown"), boost::archive::archive_exception::input_stream_error);
}
/**
* Test of DataSet constructor with vector parameter
*/
BOOST_AUTO_TEST_CASE(DataSet_construction_from_vector_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
//test of no exception when create object DataSet
BOOST_CHECK_NO_THROW(DataSet dataSet(&data_vec));
}
/**
* Test of get_data method
*/
BOOST_AUTO_TEST_CASE(DataSet_get_data_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 1; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
//test of equal data
//TODO out of range, ==
BOOST_CHECK_EQUAL(0, dataSet.get_data()->at(0).first.at(0));
BOOST_CHECK_EQUAL(4, dataSet.get_data()->at(0).second.at(0));
}
/**
* Test of add_data_pair method
*/
BOOST_AUTO_TEST_CASE(DataSet_add_daata_pair_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
inp.clear();
out.clear();
for (int i = 8; i < 11; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
dataSet.add_data_pair(inp, out);
// Test of correct add of input
BOOST_CHECK_EQUAL(8, dataSet.get_data()->at(1).first.at(0));
// Test of correct add of output
BOOST_CHECK_EQUAL(12, dataSet.get_data()->at(1).second.at(0));
}
/**
* Test of get_input_dim and get_output_dim methods
*/
BOOST_AUTO_TEST_CASE(DataSet_dimension_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
//Test of correct input dimension
BOOST_CHECK_EQUAL(3, dataSet.get_input_dim());
//Test of correct output dimension
BOOST_CHECK_EQUAL(3, dataSet.get_output_dim());
}
/**
* Test of get_n_elements method
*/
BOOST_AUTO_TEST_CASE(DataSet_get_number_of_elements_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
inp.clear();
out.clear();
for (int i = 8; i < 11; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
//Test of correct number of elements
BOOST_CHECK_EQUAL(2, dataSet.get_n_elements());
}
/**
* Test of print_data method
*/
BOOST_AUTO_TEST_CASE(DataSet_print_data_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 1; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
boost::test_tools::output_test_stream output;
{
cout_redirect guard(output.rdbuf());
dataSet.print_data();
}
//Test of correct print of DataSet
BOOST_CHECK(output.is_equal("0 -> 4 \n"));
}
/**
* Test of store_text method
*/
BOOST_AUTO_TEST_CASE(DataSet_store_text_test) {
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
int elements = dataSet.get_n_elements();
std::string filename = "testDataSet";
dataSet.store_text(filename);
//Test of correct file creations
//BOOST_CHECK(boost::filesystem::exists( "testDataSet" ));
DataSet newDataSet("testDataSet");
//Test of correct number of element from dataSet from file
BOOST_CHECK_EQUAL(elements, newDataSet.get_n_elements());
// removing of created file
remove("testDataSet");
}
BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
/**
* DESCRIPTION OF THE CLASS
*
* @author David Vojtek
* @date 2018
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include "../ErrorFunction/ErrorFunctions.h"
/**
* Boost testing suite for testing ErrorFunction.h
* doesn't test inherited methods
*/
BOOST_AUTO_TEST_SUITE(ErrorFunctions_test)
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_Construction_Test) {
NeuralNetwork network;
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 3; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
DataSet dataSet(&data_vec);
BOOST_CHECK_NO_THROW(MSE mse(&network, &dataSet));
}
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_Eval_Test) {
Neuron *n1 = new NeuronLinear();
Neuron *n2 = new NeuronLinear();
NeuralNetwork network;
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 1; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
network.add_neuron(n1);
network.add_neuron(n2);
network.add_connection_simple(0, 1, SIMPLE_CONNECTION_TYPE::UNITARY_WEIGHT, 2.5);
network.randomize_weights();
std::vector<size_t> net_input_neurons_indices(1);
std::vector<size_t> net_output_neurons_indices(1);
net_input_neurons_indices[0] = 0;
net_output_neurons_indices[0] = 1;
network.specify_input_neurons(net_input_neurons_indices);
network.specify_output_neurons(net_output_neurons_indices);
DataSet dataSet(&data_vec);
std::vector<double> weights;
weights.push_back(1);
MSE mse(&network, &dataSet);
BOOST_CHECK_EQUAL(9, mse.eval(&weights));
}
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_Get_dimension_test) {
Neuron *n1 = new NeuronLinear();
Neuron *n2 = new NeuronLinear();
NeuralNetwork network;
std::vector<std::pair<std::vector<double>, std::vector<double>>> data_vec;
std::vector<double> inp, out;
for (int i = 0; i < 1; i++) {
inp.push_back(i);
out.push_back(i + 4);
}
data_vec.emplace_back(std::make_pair(inp, out));
network.add_neuron(n1);
network.add_neuron(n2);
network.add_connection_simple(0, 1, SIMPLE_CONNECTION_TYPE::UNITARY_WEIGHT, 2.5);
network.randomize_weights();
std::vector<size_t> net_input_neurons_indices(1);
std::vector<size_t> net_output_neurons_indices(1);
net_input_neurons_indices[0] = 0;
net_output_neurons_indices[0] = 1;
network.specify_input_neurons(net_input_neurons_indices);