如何在Python中建立游戏神经网络? [英] how to build game playing neural network in Python?

查看:161
本文介绍了如何在Python中建立游戏神经网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是神经网络初学者.我想通过教计算机玩跳棋来学习神经网络的基础知识.实际上,我要学习的游戏是霸气

I am a neural-network beginner. I'd like to learn the basics of neural networks by teaching computers to play checkers. Actually, the games I want to learn are Domineering and Hex.

这些游戏非常易于存储,规则比国际象棋简单得多,但是玩游戏的人并不多.如果我能把这个想法付诸实践,那对尝试组合游戏理论非常有用.

These games are pretty easy to store and the rules are much simpler than chess, but there aren't too many people who play. If I can get this idea off the ground it would be great for experimenting Combinatorial Game Theory.

PyBrain 似乎是Python神经网络的明显赢家,但谁能引导我逐步了解如何建立神经网络我的游戏任务需要神经网络吗? Google搜索于2001年出现 Blondie24 ,但它使用了一些遗传算法-我不想使事情复杂化.

PyBrain seems to be the clear winner for Python neural networks, but who can walk me through how to set up a neural net for my game-playing task? A google search turned up Blondie24 in 2001 but it uses some genetic algorithms - I don't want to complicate things.

推荐答案

一旦您用机器学习(甚至是人工智能,而不是imho)替换了神经网络" ),如评论所建议的那样,我认为您最好从 Alpha-beta修剪, Minimax算法

Once you replace "neural networks" by machine learning (or even artificial intelligence, rather, imho) as the comments rightly suggest, I think you're better off starting with Alpha-beta pruning, the Minimax algorithm, and Branch and bound ideas.

基本上:

  • 在每一步中,您都将构建所有可能的期货的树,并使用评估函数(例如,板块支配性,连通性,材料等)来评估叶片位置
  • 将结果传播到树上,选择您可以做出的最好的比赛,而对手却可以做出的更糟的比赛(对他来说最好),直到您知道自己所处位置的动作.
  • 冲洗,重复一次.如果您具有一些良好的启发式方法,则分支定界操作可以节省大量计算时间,并且编程的级别基本上将是能够搜索游戏树的深度.
  • At each step, you build the tree of all possible futures, and evaluate leaf positions with an evaluation function (e.g. board domination, connectivity, material, etc.)
  • Propagate the results up in the tree, choosing the best play you can make, and the worse your opponent can (the best for him), until you know what move to play in the position you're at.
  • Rinse, repeat. Branch and bound saves you a lot of computation if you have a few good heuristics, and the level of your programm will basically be how deep it'll be able to search the game tree.

这很可能是任何人都可以引入新思想的基本框架,因此,如果您不熟悉它,请:-)

This will most probably be the basic framework in which anyone would introduce new ideas, so if you're not familiar with it, go for it :-)

这篇关于如何在Python中建立游戏神经网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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