且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找到匹配输入和输出的数学算法

更新时间:2022-12-01 13:02:56

对于任何类型的输入/输出信号依赖性,您都无法可靠地做到这一点,而您应该只支持一些,否则您需要某种 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 和输出 y0,y1,y2,y3,..
  • k0=y0/x0,k1=y1/x1,...
  • 如果 k0 或 k0>>k1>>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

[注释]

所以你需要指定:

  • 将支持哪种依赖项(类型、单数、组合)
  • 您有多少输入点(最少、推荐等...)
  • 什么是目标精度/误差
  • x,y 的目标范围是多少