UncoDong / snake

Snake AI with Genetic algorithm and Neural network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snake AI

使用遗传算法和简单神经网络实现贪吃蛇,其中

  • 遗传算法进化神经网络的参数
  • 神经网络预测移动方向

遗传算法

  • 交叉算子:单点交叉
  • 变异算子:高斯变异
  • 选择算子:轮盘赌选择

神经网络

  • 网络结构:[32, 12, 8, 4]
  • 隐含层激活函数:Relu
  • 输出层激活函数:Sigmoid
  • 输入层包括:
    • 蛇首方向:[0, 1, 0, 0]
    • 蛇尾方向:[1, 0, 0, 0]
    • 蛇首八个方向上
      • 是否有食物
      • 是否有自身
      • 与边缘的距离
  • 输出层表示四个移动方向

About

Snake AI with Genetic algorithm and Neural network


Languages

Language:Python 100.0%