artificial-intelligence

Clarification on a Neural Net that plays Snake

江枫思渺然 提交于 2019-11-26 03:25:33
问题 I\'m new to neural networks/machine learning/genetic algorithms, and for my first implementation I am writing a network that learns to play snake (An example in case you haven\'t played it before) I have a few questions that I don\'t fully understand: Before my questions I just want to make sure I understand the general idea correctly. There is a population of snakes, each with randomly generated DNA. The DNA is the weights used in the neural network. Each time the snake moves, it uses the

What is the optimal algorithm for the game 2048?

二次信任 提交于 2019-11-26 02:59:19
问题 I have recently stumbled upon the game 2048. You merge similar tiles by moving them in any of the four directions to make \"bigger\" tiles. After each move, a new tile appears at random empty position with a value of either 2 or 4 . The game terminates when all the boxes are filled and there are no moves that can merge tiles, or you create a tile with a value of 2048 . One, I need to follow a well-defined strategy to reach the goal. So, I thought of writing a program for it. My current

Role of Bias in Neural Networks

馋奶兔 提交于 2019-11-26 00:26:37
问题 I\'m aware of the Gradient Descent and the Back-propagation Theorem. What I don\'t get is: When is using a bias important and how do you use it? For example, when mapping the AND function, when I use 2 inputs and 1 output, it does not give the correct weights, however, when I use 3 inputs (1 of which is a bias), it gives the correct weights. 回答1: I think that biases are almost always helpful. In effect, a bias value allows you to shift the activation function to the left or right , which may

Python: Justifying NumPy array

萝らか妹 提交于 2019-11-25 22:41:55
问题 Please I am a bit new to Python and it has been nice, I could comment that python is very sexy till I needed to shift content of a 4x4 matrix which I want to use in building a 2048 game demo of the game is here I have this function def cover_left(matrix): new=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] for i in range(4): count=0 for j in range(4): if mat[i][j]!=0: new[i][count]=mat[i][j] count+=1 return new This is what this function does if you call it like this cover_left([ [1,0,2,0], [3,0,4