added perfomance tests

This commit is contained in:
2016-02-07 23:08:57 +01:00
parent 782ac8d1e8
commit 0cdedd38f7
3 changed files with 35 additions and 0 deletions

View File

@@ -62,8 +62,21 @@ add_subdirectory (tests)
enable_testing()
add_test(activation tests/backpropagation)
set_property(TEST activation PROPERTY LABELS unit)
add_test(backpropagation tests/backpropagation)
set_property(TEST backpropagation PROPERTY LABELS unit)
add_test(basis tests/basis)
set_property(TEST basis PROPERTY LABELS unit)
add_test(feedforward tests/feedforward)
set_property(TEST feedforward PROPERTY LABELS unit)
add_test(recurrent tests/recurrent)
set_property(TEST recurrent PROPERTY LABELS unit)
add_test(feedforward_perf tests/feedforward_perf)
set_property(TEST feedforward_perf PROPERTY LABELS perf)
ENDIF(ENABLE_TESTS)

View File

@@ -13,5 +13,8 @@ target_link_libraries(backpropagation NeuralNetwork)
add_executable(feedforward feedforward.cpp)
target_link_libraries(feedforward NeuralNetwork)
add_executable(feedforward_perf feedforward_perf.cpp)
target_link_libraries(feedforward_perf NeuralNetwork)
add_executable(recurrent recurrent.cpp)
target_link_libraries(recurrent NeuralNetwork)

View File

@@ -0,0 +1,19 @@
#include <NeuralNetwork/FeedForward/Network.h>
#include <cassert>
#include <iostream>
int main() {
{ // XOR problem
NeuralNetwork::FeedForward::Network n(2);
NeuralNetwork::ActivationFunction::Sigmoid a(-1);
n.appendLayer(2000,a);
n.appendLayer(2000,a);
n.appendLayer(1,a);
for(int i=0;i<500;i++) {
n.computeOutput({1,1});
}
}
}