remove \r
[extl.git] / extl / intelligence / ann / test / perceptron_network_test.h
blob8cde5bec1aa5ec6bb0ad08838218c9eb4f085536
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: perceptron_network_test.h
4 * Created: 08.12.17
5 * Updated: 08.12.17
7 * Brief: Unit-testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_INTELLIGENCE_ANN_PERCEPTRON_NETWORK_TEST_H
13 #define EXTL_INTELLIGENCE_ANN_PERCEPTRON_NETWORK_TEST_H
15 /* ///////////////////////////////////////////////////////////////////////
16 * unit_test namespace
18 EXTL_INTELLIGENCE_BEGIN_WHOLE_NAMESPACE
19 EXTL_TEST_NAME_BEGIN_NAMESPACE(perceptron_network_test)
21 /* ///////////////////////////////////////////////////////////////////////
22 * Unit-testing
24 static int perceptron_network_test()
26 /* ///////////////////////////////////////////////////////////////////////
27 * train and
29 * 0 0 => 0
30 * 0 1 => 0
31 * 1 0 => 0
32 * 1 1 => 1
34 EXTL_TEST_TRACE(_T("perceptron_network_test: train and\n"));
35 typedef perceptron_network<2, 1> and_perceptron_type;
36 typedef and_perceptron_type::layers_type and_layers_type;
37 and_perceptron_type and_perceptron(10, 0.5);
38 EXTL_NS_TEST(and_tester)<and_perceptron_type> atr;
39 atr.test(and_perceptron, 1000);
41 return 0;
43 int perceptron_network_test_ret = perceptron_network_test();
45 /* ///////////////////////////////////////////////////////////////////////
46 * ::unit_test namespace
48 EXTL_TEST_NAME_END_NAMESPACE(perceptron_network_test)
49 EXTL_INTELLIGENCE_END_WHOLE_NAMESPACE
50 /* //////////////////////////////////////////////////////////////////// */
51 #endif /* EXTL_INTELLIGENCE_ANN_PERCEPTRON_NETWORK_TEST_H */
52 /* //////////////////////////////////////////////////////////////////// */