使用遗传算法的神经网络用于乒乓球或超级马齿苋(Using a neural network with genetic algorithm for pong or supermario)

编程入门 行业动态 更新时间:2024-10-23 21:33:17
使用遗传算法的神经网络用于乒乓球或超级马齿苋(Using a neural network with genetic algorithm for pong or supermario)

我正在尝试使用GA来训练一个人工神经网络,其工作是垂直移动一个条形,这样它就可以在没有撞到酒吧后面的墙壁的情况下弹出一个球,换句话说就是一个单杆。 我会直接问它,因为我想知道问题是什么。 游戏窗口是200x200像素,所以我创建了40000个输入神经元。 显而易见的疑问是:GA可以处理40000(输入)* 10(隐藏)* 2元素(基因)的染色体吗? 因为我认为答案是否定的(我实现了这个解决方案似乎不起作用),解决方案似乎很简单,我只用4个参数来提供NN,这些参数是bar和ball的坐标x,y,钉它。 很好的解决方案,但问题是:如何在像supermario这样的游戏中应用这样的解决方案,其中屏幕上的敌人数量不固定? 当然,我无法创建具有动态输入数量的NN。 我希望你能帮助我。

I'm trying to use GA to train an ANN whose job is to move a bar vertically so that it makes a ball bounce without hitting the wall behind the bar, in other words, a single bar pong. I'm going to ask it directly because i think to know what the problem is. The game window is 200x200 pixels, so i created 40000 input neurons. The obvious doubt is: can GA handle chromosomes of 40000(input)*10(hidden)*2 elements(genes)? Since i think the answer is no(i implemented this solution and doesn't seem to work), the solution seems simple, i feed the NN with only 4 parameters which are the coordinates x,y of bar and ball, nailed it. Nice solution, but the problem is: how can i apply such a solution in a game like supermario where the number of enemies in the screen is not fixed? Surely i cannot create a NN with dynamic numbers of inputs. I hope you can help me.

最满意答案

您必须使用功能来表示您的州。 例如,您可以在平铺中划分屏幕并根据考虑敌人的函数分配值(例如,如果敌人在平铺中,则为布尔值或距离最近的敌人的距离)。

您仍然可以使用像素,但您可能需要预处理它们以减小它们的大小(例如,使用经常性NN)。

顺便说一句,NN可能无法处理200x200像素,但它能够学习使用状态的表示来播放Atari游戏,预处理的像素大小为84x84x4(参见本文 )。

You have to use features to represent your state. For example, you can divide the screen in tiles and assign a value according to a function that takes into account the enemy (e.g., a boolean if the enemy is in the tile or the distance to the closest enemy).

You can still use pixels but you might need to preprocess them in order to reduce their size (e.g., use a recurrent NN).

Btw, a NN might not be able to handle 200x200 pixels, but it was able to learn to play Atari games using a representation of the state by preprocessed pixels of size 84x84x4 (see this paper).

更多推荐

本文发布于:2023-07-16 07:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125497.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:马齿苋   神经网络   乒乓球   算法   neural

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!