找到的数学算法来将输入和输出一起相匹配 [英] Finding the mathematical algorithm to which matches an input and output together

查看:162
本文介绍了找到的数学算法来将输入和输出一起相匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为一个最终的结果,我想一个计算机程序,它可以接受的输入和输出的列表,然后采用相同的算法,走进这些输入/输出的另一个数值,即:

As an end result, I would like a computer program which can accept a list of inputs and outputs and then apply the same algorithm that went into those input/output's on another number, I.e:

如果给定的输入列表/输出的

If given this list of input/output's

2:4
4:8
100:200

有会意识到,该算法将是(输入* 2),或(输出/ 2),这取决于我们想要的。

It would realize that the algorithm would be (input * 2), or (output / 2) depending on what we wanted.

因此​​,如果给定的数16,并要求以产生一个输出的程序将与32响应而如果给出​​的数字10,并要求以产生一个输入,它将反应与5

So, if given the number 16, and asked to produce an output the program would respond with 32. And if given the number 10 and asked to produce an input, it would respond with 5.

这显然是相当简单的硬code'到这一程序,但我想了解如何有计划教本身的算法是什么。据我所知,这将得到相当复杂,相当快的。

It would obviously be rather simple to 'hardcode' this into the program, although I'd like to learn how to have the program teach itself what the algorithm is. I understand that this will get rather complicated rather fast.

推荐答案

你不能这样做可靠地为任何类型的输入/输出信号的依赖,而不是你应该只支持一些,否则你需要某种形式的AI或很复杂神经网络+ 许多功能发电机疯狂的复杂性和解决方案的可靠性不明......

you can not do this reliably for any type of input/output signal dependency instead you should support only some otherwise you need some kind of AI or very complex neural network + many functional generators with insane complexity and unknown reliability of the solution ...

我将简化这依赖这样的:

  1. 多项式到一定程度

  1. polynomial up to some degree

  • (可以使用任何插值/近似)
  • Y = A0 + A1 * X + A2 * X * X + A3 * X * X * X

指数

  • Y = A0 + A1 ^ X

  • 如果你想支持像罪波等,那么你就需要很多的投入不仅仅是几个决定依赖关系的类型。

无论如何,我认为只有3个输入点会不够

Anyway I think just 3 input points will be not enough

  • 例如多项式 A0 + A1 * X + A2 * X * X + A3 * X * X * X = Y 至少需要4个点
  • for example polynomial a0+a1*x+a2*x*x+a3*x*x*x=y needs at least 4 points

所以刚开始,你应该确定它是哪种类型的依赖,然后试图找到该特定函数发生器的系数。例如:

So at first you should determine which type of dependency it is and then try to find the coefficients of that particular function generator. For example:

  • 如果您输入 X0< X1< X2< X3,... 和输出 Y0,Y1,Y2,Y3,...
  • K0 = Y0 / X0,K1 = Y1 / X1,...
  • 如果 K0<< K1 - LT;< K2<< K3<< ... K0>> K1>&GT ; K2>> K3>> ... 很可能是指数的依赖
  • 以其它方式使用多项式...
  • if you have inputs x0<x1<x2<x3,... and outputs y0,y1,y2,y3,..
  • and k0=y0/x0,k1=y1/x1,...
  • if k0<<k1<<k2<<k3<<... or k0>>k1>>k2>>k3>>... it is probably exponential dependency
  • otherwise use polynomial ...

如果您有混合型的信号,那么你需要更多的输入点覆盖足够大的范围,可能会需要某种近似搜索< /一个系数最小化已知的输入和产生的输出之间的距离>。如果你有足够的积分,你可以标准化数据集,并使用相关系数将其与比较支持的函数发生器简化的决策

If you have mixed type signals then you need much more input points covering big enough range and probably would need some kind of approximation search of coefficients minimizing the distance between known inputs and generated output. If you have enough points you can normalize dataset and use correlation coefficient to compare it with supported function generators to simplify the decisioning

[注意事项]

所以,你需要指定:

  • 在什么样的相关性将得到支持(类型,奇,组合)
  • 您有多少个输入点有(最低,建议等)
  • 什么是目标precision /错误
  • 什么是x的目标范围,Y

这篇关于找到的数学算法来将输入和输出一起相匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆