artificial-intelligence

Implementing a Top Down Parser in C#

耗尽温柔 提交于 2019-12-11 11:49:37
问题 i am Student and i want to implement a top down parser in my language translation project that is developed using c# language. for example if i need to construct a parser tree for the sentence "My Name is Husni and i am a Student" how can i do it in C# language. 回答1: After the book you can also find interesting to read about a compiler generator as ANTLR that can help you to write the compiler ( also in C# ) and browsing the AST even visually. 回答2: I highly recommend this book: Basics of

Pytorch - Getting gradient for intermediate variables / tensors

南楼画角 提交于 2019-12-11 11:34:45
问题 As an exercice in pytorch framework (0.4.1) , I am trying to display the gradient of X (gX or dSdX) in a simple Linear layer (Z = X.W + B). To simplify my toy example, I backward() from a sum of Z (not a loss). To sum up, I want gX(dSdX) of S=sum(XW+B). The problem is that the gradient of Z (dSdZ) is None . As a result, gX is wrong too of course. import torch X = torch.tensor([[0.5, 0.3, 2.1], [0.2, 0.1, 1.1]], requires_grad=True) W = torch.tensor([[2.1, 1.5], [-1.4, 0.5], [0.2, 1.1]]) B =

Unity 2d A* pathfinding project: how to make ai object patrol to random points?

妖精的绣舞 提交于 2019-12-11 10:51:20
问题 As the title states this question refers to the Unity A* pathfinding project. I downloaded this package for my maze game so that the enemy's ai could navigate through the maze. So far I have followed a tutorial ( link will be provided below ) and everything is set up. However, I don't seem to know how to implement ray casting or another method to make the enemy patrol to a random point in a continuous loop. A* Tutorial Link Note: There is a problem with my current set up though, which I have

Reason for the development of First Order Logic and PDDL

99封情书 提交于 2019-12-11 10:45:41
问题 This might be a naive question, but i am really interested to know why logic was developed to be used in AI. In particular, what was the need to develop first order logic and PDDL in AI, if we could do the programming using simple atomic representation of states? Again, I realize this is a really basic question!! 回答1: So your question is about: why do we program/model on a first-order level instead of a propositional level? Simply because it is more concise. You can make propositions like

Tensorflow softmax_cross…() function float type error

给你一囗甜甜゛ 提交于 2019-12-11 07:31:22
问题 I resolved in issue from this post, and the use Olivier recommended using the softmax_cross_entropy_with_logits() function. He is correct, but I'm getting a weird data type error. The error is tensorflow.python.framework.errors.InvalidArgumentError: You must feed a value for placeholder tensor 'ground_truth' with dtype float [[Node: ground_truth = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]] The softmax loss function requires data type float...

Needed advice for an enjoyable AI in Buraco card game

自古美人都是妖i 提交于 2019-12-11 07:25:45
问题 i’m trying to build an effective AI for the Buraco card game (2 and 4 players). I want to avoid the heuristic approach : i’m not an expert of the game and for the last games i’ve developed this way i obtained mediocre results with that path. I know the montecarlo tree search algorithm, i’ve used it for a checkers game with discrete result but I’m really confused by the recent success of other Machine Learning options. For example i found this answer in stack overflow that really puzzles me,

How to compute the running time of A-star algorithm

[亡魂溺海] 提交于 2019-12-11 06:37:35
问题 I am working with A* algorithm. I have a 2D grid, with some obstacles, and given the starting and final position, I find the shortest path between them. Here's my pseudocode while(queueNotEmpty){ removeFromPQ; if(removed == destination) found; insertAllNeighbours; } Remove and insert are the function on priority queue(Heap), and is O(log(n)) time. Considering the dimension of grid as N*N. How do I calculate the running time. i.e how many times will this loop execute? Is there any measure? 回答1

Constraint Satisfaction with Uncertainty

别等时光非礼了梦想. 提交于 2019-12-11 06:29:24
问题 I'm trying to solve a problem in which the satisfaction of constraints cannot always be verified. I can find lots of papers on flexible constraint satisfaction, but that's not quite what I want. Here's an example: P(Jim likes Cheese) = 0.8 P(Joe likes Cheese) = 0.5 P(Sam likes Cheese) = 0.2 P(Jim and Sam are friends) = 0.9 P(Jim and Joe are friends) = 0.5 P(Joe and Sam are friends) = 0.7 Charlie is talking about two cheese-liking friends. Who is he most likely talking about? I'm currently

Heuristic function for Water Jug

冷暖自知 提交于 2019-12-11 05:38:35
问题 I have a problem in Hill Climbing algorithm with Water Jug Problem : Given two jugs, one of which can accommodate X liters of water and the other which can accommodate Y liters of water, determine the number of steps required to obtain exactly D liters of water in one of the jugs. From the start state, (X,Y) = (0,0), it can generate some states : (X,Y) = (0,Y) or (X,Y) = (X,0) And from these states, it can generate others until the end state that is either (X,D) or (D,Y). So, Can I estimate

Weights optimization of a neural network using Genetic Algorithm

强颜欢笑 提交于 2019-12-11 05:32:21
问题 I was told to implement a neural network to do forecasting. So I created a Feed Forward MultiLayer Perceptron with a Backpropagation algorithm and it is working fine. But I need to get results faster and faster. So I thaught about genetic algorithm t ooptimize the weights in the training session. How do you suggest to encode the chromosme ? I already done it as a table of weights generated randomly (-100, 100) but it's not giving extraordinary results. I guess that the problem is that