-2

我正在尝试与 FANN 合作,我想要函数逼近。我不知道我的数据和我的输出之间是否存在相关性,所以我无法判断这个输出是否意味着没有相关性,或者我是否做错了。

这是我的培训计划,我链接 -ldoublefann

#include "fann.h"

int main()
{
        const float connection_rate = 1;
        const float learning_rate = 0.7;
        const unsigned int num_input = 14;
        const unsigned int num_output = 2;
        const unsigned int num_layers = 3;
        const unsigned int num_neurons_hidden = 4;
        const float desired_error = 0.0001;
        const unsigned int max_iterations = 20000;
        const unsigned int iterations_between_reports = 1000;

        struct fann *ann = fann_create_standard (num_layers,
                num_input, num_neurons_hidden, num_output);

        fann_train_on_file(ann, "t120.train", max_iterations,
                iterations_between_reports, desired_error);

        fann_save(ann, "t120.net");

        fann_destroy(ann);

        return 0;
}

我的 Makefile

CFLAGS=-ldoublefann

all: train
train: train.c

输出如下:

Max epochs    20000. Desired error: 0.0001000000.
Epochs            1. Current error: 1426.2332763672. Bit fail 568.
Epochs         1000. Current error: 1403.6292724609. Bit fail 569.
Epochs         2000. Current error: 1403.6292724609. Bit fail 569.
Epochs         3000. Current error: 1403.6292724609. Bit fail 569.
Epochs         4000. Current error: 1403.6292724609. Bit fail 569.
Epochs         5000. Current error: 1403.6292724609. Bit fail 569.

我正在看这个,它取得了一些初步进展,然后停止了。我不知道位失败是什么意思,也许是我的问题,它可能认为我在做二进制数据而不是双精度浮点。

这是我的数据:

我的数据太大,无法添加到帖子中

我的数据由大约 285 行组成,有 14 个输入和 2 个输出。

我这样做是否正确并且不相关?还是我做错了什么?

4

1 回答 1

0

您需要:

  1. #include "fann.h"和链接-lfann
  2. #include "doublefann.h"和链接-ldoublefann

看到这个讨论和这个问题,有人有类似的问题。

于 2015-11-04T18:22:01.100 回答