什么机器学习算法适合投篮?
我们正在制造一个可以将篮球投进篮筐的机器人。
根据图像以及我们对相机角度和目标尺寸(目标涂有反光带)的了解,我们知道我们距离 X 和 Y 有多远(距离为 Z,或多或少),
并将其输入机器中学习算法,应该吐出
- 来 发送到佳能的速度
- 水平倾斜
- 垂直倾斜
这是什么样的机器学习算法,您将如何训练它?
We are making a robot that shoots basketballs into hoops.
From an image and our knowledge of the camera's angle and the target's dimensions (the targets are coated with retroreflective tape), we know how far away we are, X and Y (distance being Z, more or less)
This is fed into the machine learning algorithm, which should spit out
- Speed to be sent to the canon
- Horizontal tilt
- Vertical tilt
What kind of machine learning algorithm is this, and how would you train it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
机器学习可能不适合这项任务。至少,它本身不是。使用物理学。你应该能够从第一学期的物理教科书中得到一个粗略的公式,尽管你需要决定你的目标是瞄准篮筐的中间还是它后面的板。
您的物理公式应该告诉您要使用的角度和力,但您的系统模型会有一些不准确。不同的球可能有不同的质量,您可能不想明确考虑空气阻力,等等。根据前一个镜头的距离来搜索偏移空间是可行的。搜索方法的选择取决于您 - 正如 Mencel 所说,模拟退火可以很好地发挥作用。
机器学习的一种可能用途可能是记住并推断这些偏移量。函数逼近器(例如神经网络)可用于从经验中学习偏移量。一旦您的搜索方法成功将球放入篮筐,请将此作为近似器的训练示例,该近似器学习从物理模型所说的内容映射到使投篮成功的偏移量。然后,对于下一个镜头(从任何位置),函数逼近器将用于猜测要使用的偏移量。如果该镜头未命中,请重复搜索,直到找到正确的偏移。更新函数逼近器、冲洗并重复。此外,如果您的函数逼近器以最初总是说不应用偏移的方式初始化,这可能会很有用 - 毕竟,最好的第一个猜测应该是只使用物理模型告诉您使用的内容。
Machine Learning is probably not appropriate for this task. At least, not by itself. Use physics. You should be able to get a rough formula for this out of a first-semester physics textbook, though you'll need to decide whether you're aiming for the middle of the hoop or the board behind it.
Your physics formulae should tell you the angle and force to use, but your model of the system will have some inaccuracies. Different balls may have different mass, and you might not want to explicitly account for air resistance, and so on. A search through the space of offsets based on how close the previous shot was could work. The choice of search methods is up to you - simulated annealing could work well, as Mencel said.
One possible use for machine learning here might be to remember and extrapolate these offsets. A function approximator (such as a neural network) could be used to learn the offsets from experience. Once your search method succeeds at putting the ball in the hoop, use this as a training example for an approximator that learns to map from what the physics model says to use to the offsets that made the shot work. Then, for the next shot (from whatever position), the function approximator would be used to guess the offsets to use. If that shot misses, repeat the search until correct offsets are found. Update the function approximator, rinse, and repeat. Also, it would probably be beneficial if your function approximator were initialized in such a way that it initially always says to apply no offsets - after all, the best first guess should be to just use what the physics model tells you to use.
我会推荐强化学习方法。会很慢;因此,也许您可以使用自己的估计(基础物理)初始化解决方案,并通过强化学习对其进行改进。
I would recommend a reinforcement learning approach. It'll be slow ; so maybe you could initialize the solution with your own estimate (basic physics) and refine it with reinforcement learning.