artificial-intelligence

What is a Heuristic Function

[亡魂溺海] 提交于 2019-11-30 14:14:38
Can someone explain in very simple words what it is. Also provide an example. So for example if u have to find the heuristic function of something how is it supposed to look like? Take as an example the problem: For the water jug problem http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm Devise and explain an admissible heuristic function (h) [not the trivial h(n) = 0]. The cost of an action is defined as 1 unit for performing the action, an additional 1 unit for moving each gallon of water (fill, empty, pour), and an additional 1 unit for wasting each gallon of water (empty). The

Line detection | Angle detection with Java

北城以北 提交于 2019-11-30 14:01:42
问题 I'm processing some images that my UGV (Unmanned Ground Vehichle) captures to make it move on a line. I want to get the angle of that line based on the horizon. I'll try to explain with a few examples: The image above would make my UGV to keep straight ahead, as the angle is about 90 degrees. But the following would make it turn left, as the angle compaired to the horizon rounds about 120. I could successfully transform those images into the image below using otsu for thresholding: And also

Alpha-beta pruning for Minimax

只谈情不闲聊 提交于 2019-11-30 13:53:24
问题 I have spent a whole day trying to implement minimax without really understanding it. Now, , I think I understand how minimax works, but not alpha-beta pruning. This is my understanding of minimax: Generate a list of all possible moves, up until the depth limit. Evaluate how favorable a game field is for every node on the bottom. For every node, (starting from the bottom), the score of that node is the highest score of it's children if the layer is max. If the layer is min, the score of that

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

孤者浪人 提交于 2019-11-30 12:33:57
问题 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

Weak Classifier

笑着哭i 提交于 2019-11-30 11:41:24
I am trying to implement an application that uses AdaBoost algorithm. I know that AdaBoost uses set of weak classifiers, but I don't know what these weak classifiers are. Can you explain it to me with an example and tell me if I have to create my own weak classifiers or I'm suppoused to use some kind of algorithm? marc_ferna When I used AdaBoost, my weak classifiers were basically thresholds for each data attribute. Those thresholds need to have a performance of more than 50%, if not it would be totally random. Here is a good presentation about Adaboost and how to calculate those weak

How to proceed with NLP task for recognizing intent and slots

谁说我不能喝 提交于 2019-11-30 10:24:43
问题 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. 回答1: Since your input is in the natural language form,

AI How to model genetic programming for Battleships

吃可爱长大的小学妹 提交于 2019-11-30 10:21:28
I have a question regarding Genetic Programming. I am going to work on a genetic algorithm for a game called Battleships . My question is: How would I decide upon a "decision" model for the AI to evolve? And how does that work? I have read multiple papers and multiple answers that just speak about using different models, but could not find something specific, which, unfortunately, I apparently need to wrap my head around the problem. I want it to evolve over multiple iterations and "learn" what works best, but not sure how to save these "decisions" (I know to a file, but "encoded" how?) in a

Which is the best programming language to write a web bot? [closed]

喜你入骨 提交于 2019-11-30 10:08:53
I want know which programming language provides good number of libraries to program a web bot? Something like crawling a web page for data. Say I want fetch weather for weather.yahoo.com website. Also will the answer be same for a AI desktop bot? Here is how you could do it in Python: from urllib2 import urlopen from BeautifulSoup import BeautifulSoup soup=BeautifulSoup(urlopen("http://weather.yahoo.com/").read()) for x in soup.find(attrs={"id":"myLocContainer"}).findAll("li"): print x.a["title"], x.em.contents Prints: Full forecast for Chicago, Illinois, United States (Haze) [u'35...47 °F']

What is the best data-structure to represent a checkers board when speed is the primary concern?

谁都会走 提交于 2019-11-30 09:14:39
I am currently implementing something quite similar to checkers. So, I have this table game and there are both white and black pieces. Where there are neither white or black pieces, you dno't have pieces. I'm currently doing the GetValidMoves() method that'll return all the current moves one can do with the current board. I am thus wondering what might be the best way to represent the board. The naive approach would be to have a matrix with 0's 1's and 2's (for no piece, white piece and black piece). Other idea would be to instead of a matrix representation of the board, have 2 lists(or any

Tensor` objects are not iterable when eager execution is not enabled. To iterate over this tensor use `tf.map_fn`

ぐ巨炮叔叔 提交于 2019-11-30 09:10:46
I am trying to create my own loss function: def custom_mse(y_true, y_pred): tmp = 10000000000 a = list(itertools.permutations(y_pred)) for i in range(0, len(a)): t = K.mean(K.square(a[i] - y_true), axis=-1) if t < tmp : tmp = t return tmp It should create permutations of predicted vector, and return the smallest loss. "`Tensor` objects are not iterable when eager execution is not " TypeError: `Tensor` objects are not iterable when eager execution is not enabled. To iterate over this tensor use `tf.map_fn`. error. I fail to find any source for this error. Why is this happening? Thanks for hel.