artificial-intelligence

Return bestMove in minimax algorithm for tictactoe

柔情痞子 提交于 2019-11-30 04:25:36
I have tried to code the minimax algorithm for tic-tac-toe given in Russel Norvig's book on Artificial Intelligence. It had everything except that the way to return the bestMove to the user. I am trying hard to return the bestMove, but cannot decide when to choose the bestMove. Help, anyone? moveT MiniMax(stateT state) { moveT bestMove; max_move(state,bestMove); return bestMove; } int max_move(stateT state,int & bestMove) { int v = -10000; if(GameIsOver(state)) { return EvaluateStaticPosition(state); } vector<moveT> moveList; GenerateMoveList(state, moveList); int nMoves = moveList.size(); for

Are evolutionary algorithms and neural networks used in the same domains?

醉酒当歌 提交于 2019-11-30 03:15:26
I am trying to get a feel for the difference between the various classes of machine-learning algorithms. I understand that the implementations of evolutionary algorithms are quite different from the implementations of neural networks. However, they both seem to be geared at determining a correlation between inputs and outputs from a potentially noisy set of training/historical data. From a qualitative perspective, are there problem domains that are better targets for neural networks as opposed to evolutionary algorithms? I've skimmed some articles that suggest using them in a complementary

What is a derivative of the activation function used for in backpropagation?

删除回忆录丶 提交于 2019-11-30 02:45:30
I am reading this document, and they stated that the weight adjustment formula is this: new weight = old weight + learning rate * delta * df(e)/de * input The df(e)/de part is the derivative of the activation function, which is usually a sigmoid function like tanh . Now, what is this actually for? Why are we even multiplying with that? Why isn't just learning rate * delta * input enough? This question came after this one and is closely related to it: Why must a nonlinear activation function be used in a backpropagation neural network? . doug Training a neural network just refers to finding

AI algorithm for “RaceTrack” game

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:54:21
does anyone know (or can suggest) a good algorithm for an AI for the RaceTrack pencil-paper game? since you have 9 possible choices in each step and you need to look at least 6-10 steps ahead to decide on a good strategy, bruteforce is getting very expensive even if you can rule out some choices because of intersection with the boundary. Currently I'm trying to assign each choice some quality value in order to decide which choices to rule out - but I don't know good rules yet on how to assign such a quality value. I have made a C++ solver that's a bit too long (187 lines) to fit comfortably

Tensorflow accuracy at .99 but predictions awful

耗尽温柔 提交于 2019-11-29 23:13:14
问题 Maybe I'm making predictions wrong? Here's the project... I have a greyscale input image that I am trying to segment. The segmentation is a simple binary classification (think of foreground vs background). So the ground truth (y) is a matrix of 0's and 1's -- so there's 2 classifications. Oh and the input image is a square, so I just use one variable called n_input My accuracy essentially converges to 0.99 but when I make a prediction I get all zero's. EDIT --> there is a single 1 in each

Algorithm for solving Flow Free Game

时光总嘲笑我的痴心妄想 提交于 2019-11-29 23:07:15
I recently started playing Flow Free Game . Connect matching colors with pipe to create a flow. Pair all colors, and cover the entire board to solve each puzzle in Flow Free. But watch out, pipes will break if they cross or overlap! I realized it is just path finding game between given pair of points with conditions that no two paths overlap. I was interested in writing a solution for the game but don't know where to start. I thought of using backtracking but for very large board sizes it will have high time complexity. Is there any suitable algorithm to solve the game efficiently. Can using

How to create a good evaluation function for a game?

萝らか妹 提交于 2019-11-29 21:48:06
I write programs to play board game variants sometimes. The basic strategy is standard alpha-beta pruning or similar searches, sometimes augmented by the usual approaches to endgames or openings. I've mostly played around with chess variants, so when it comes time to pick my evaluation function, I use a basic chess evaluation function. However, now I am writing a program to play a completely new board game. How do I choose a good or even decent evaluation function? The main challenges are that the same pieces are always on the board, so a usual material function won't change based on position,

How to proceed with NLP task for recognizing intent and slots

白昼怎懂夜的黑 提交于 2019-11-29 20:38:15
I wanted to write a program for asking questions about weather. What are the algorithms and techniques I should start looking at. ex: Will it be sunny this weekend in Chicago. I wanted to know the intent = weather query, date = this weekend, location = chicago. User can express the same query in many forms. I would like to solve some constrained form and looking for ideas on how to get started. The solution needs to be just good enough. Since your input is in the natural language form, best way to start looking into it, first by parsing the sentence structure. and running the sentence through

Single layer neural network [closed]

拟墨画扇 提交于 2019-11-29 20:02:11
For the implementation of single layer neural network, I have two data files. In: 0.832 64.643 0.818 78.843 Out: 0 0 1 0 0 1 The above is the format of 2 data files. The target output is "1" for a particular class that the corresponding input belongs to and "0" for the remaining 2 outputs. The problem is as follows: Your single layer neural network will find A (3 by 2 matrix) and b (3 by 1 vector) in Y = A*X + b where Y is [C1, C2, C3]' and X is [x1, x2]'. To solve the problem above with a neural network, we can re-write the equation as follow: Y = A' * X' where A' = [A b] (3 by 3 matrix) and

How to create a smart chat-bot? [closed]

瘦欲@ 提交于 2019-11-29 19:52:31
I know that it's still an open problem so I don't expect to see complete answers here. I just want to find some approaches to solve the next problem: I have a model (assume that is's bot's memory), and different words are associated with different objects in the model. Speaking with the bot is like executing sql-queries with a DB. Language is a very hard formalizable protocol. And we can't just write a million lines of code to implement some real language. But I believe that it's absolutely possible to implement some self-learning mechanism. How can it be implemented? Is it possible to