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

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

问题描述

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

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

它会意识到算法是 (input * 2) 或 (output/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.

将其硬编码"到程序中显然相当简单,尽管我想学习如何让程序自学算法是什么.我知道这会很快变得相当复杂.

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 和输出 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 的目标范围是多少

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

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