Exemplo n.º 1
0
int main()
{
	Vector<Data> data;
	for (int i = 0; i < 41; i++)
	{
		Data t;
		for (int j = 0; j < 3; j++)
			t.x.push_back(sample[i][j]);

		t.y.push_back(sample[i][0] + sample[i][1] + sample[i][2]);
		data.push_back(t);
	}
	BP *bp = new BP();
	bp->GetData(data);
	bp->Train();


	while (1)
	{
		Vector<Type> in;
		for (int i = 0; i < 3; i++)
		{
			Type v;
			scanf("%lf", &v);
			in.push_back(v);
		}
		Vector<Type> ou;
		ou = bp->ForeCast(in);
		printf("%lf\n", ou[0]);
	}
	return 0;
}