当前位置: 首页>>代码示例>>C++>>正文


C++ NeuralNetwork::get_multilayer_perceptron_pointer方法代码示例

本文整理汇总了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);
}
开发者ID:jrdodson,项目名称:opennn,代码行数:10,代码来源:neural_network_test.cpp

示例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";

//.........这里部分代码省略.........
开发者ID:pappakrishnan,项目名称:OpenNN,代码行数:101,代码来源:golden_section_order_test.cpp


注:本文中的NeuralNetwork::get_multilayer_perceptron_pointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。