本文整理汇总了C++中NeuralNetwork::get_multilayer_perceptron_pointer方法的典型用法代码示例。如果您正苦于以下问题:C++ NeuralNetwork::get_multilayer_perceptron_pointer方法的具体用法?C++ NeuralNetwork::get_multilayer_perceptron_pointer怎么用?C++ NeuralNetwork::get_multilayer_perceptron_pointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeuralNetwork
的用法示例。
在下文中一共展示了NeuralNetwork::get_multilayer_perceptron_pointer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_get_multilayer_perceptron_pointer
void NeuralNetworkTest::test_get_multilayer_perceptron_pointer(void) {
message += "test_get_multilayer_perceptron_pointer\n";
NeuralNetwork nn;
// Test
nn.set(1, 1);
assert_true(nn.get_multilayer_perceptron_pointer() != NULL, LOG);
}
示例2: test_perform_order_selection
void GoldenSectionOrderTest::test_perform_order_selection(void)
{
message += "test_perform_order_selection\n";
std::string str;
Matrix<double> data;
Vector<Instances::Use> uses;
NeuralNetwork nn;
DataSet ds;
PerformanceFunctional pf(&nn, &ds);
TrainingStrategy ts(&pf);
GoldenSectionOrder gs(&ts);
GoldenSectionOrder::GoldenSectionOrderResults* results;
// Test
str =
"-1 0\n"
"-0.9 0\n"
"-0.8 0\n"
"-0.7 0\n"
"-0.6 0\n"
"-0.5 0\n"
"-0.4 0\n"
"-0.3 0\n"
"-0.2 0\n"
"-0.1 0\n"
"0.0 0\n"
"0.1 0\n"
"0.2 0\n"
"0.3 0\n"
"0.4 0\n"
"0.5 0\n"
"0.6 0\n"
"0.7 0\n"
"0.8 0\n"
"0.9 0\n"
"1 0\n";
data.parse(str);
ds.set(data);
uses.set(21,Instances::Training);
for (size_t i = 0; i < 11; i++)
uses[2*i+1] = Instances::Generalization;
ds.get_instances_pointer()->set_uses(uses);
nn.set(1,3,1);
nn.initialize_parameters(0.0);
pf.set_objective_type(PerformanceFunctional::SUM_SQUARED_ERROR_OBJECTIVE);
ts.set_main_type(TrainingStrategy::QUASI_NEWTON_METHOD);
ts.get_quasi_Newton_method_pointer()->set_display(false);
gs.set_trials_number(1);
gs.set_maximum_order(7);
gs.set_generalization_performance_goal(1.0e-3);
gs.set_display(false);
results = gs.perform_order_selection();
assert_true(nn.get_multilayer_perceptron_pointer()->arrange_layers_perceptrons_numbers()[0] == 1, LOG);
assert_true(results->stopping_condition ==
OrderSelectionAlgorithm::GeneralizationPerformanceGoal, LOG);
// Test
str =
"-1 -1\n"
"-0.9 -0.9\n"
"-0.8 -0.8\n"
"-0.7 -0.7\n"
"-0.6 -0.6\n"
"-0.5 -0.5\n"
"-0.4 -0.4\n"
"-0.3 -0.3\n"
"-0.2 -0.2\n"
"-0.1 -0.1\n"
"0.0 0.0\n"
"0.1 0.1\n"
"0.2 0.2\n"
"0.3 0.3\n"
"0.4 0.4\n"
"0.5 0.5\n"
"0.6 0.6\n"
"0.7 0.7\n"
"0.8 0.8\n"
"0.9 0.9\n"
"1 1\n";
//.........这里部分代码省略.........