artificial-intelligence

php function to detect if the string text is meaningful text [duplicate]

泪湿孤枕 提交于 2019-12-25 19:05:59
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Is there any way to detect strings like putjbtghguhjjjanika? php check if the string is real I want to make a php function that handle a text string and path it to a special algorithm to detect if this text is meaningful or not, and rate the text from 0 to 100% readability score. For example: "skjg askjf akdjf akdjf " will take about 30%. "Hello guys" 90%. "ahdkjshdkjshdkljshdlksjdh" 10% or less. I hope that

Distance metric heuristic informedness

假装没事ソ 提交于 2019-12-25 08:49:42
问题 Having Manhattan distance heuristic and a heuristic which takes the greater value of (square root(x1-x2),square root(y1-y2)) How would you consider their informedness and are they admissable in searching the shortest path in a grid from a to b, where only horizontal and vertical movements are allowed ? While testing them in all the cases the second heuristic always takes the diagonal ways and sometimes its number of discovered nodes is significantly smaller than Manhattan. But this is not

Have trouble with obstacle avoidance in matplotlib

感情迁移 提交于 2019-12-25 05:02:04
问题 I am trying to produce an algorithm where multiple agents (blue) work together as a team to capture a slightly faster enemy agent (red) by preforming surrounding and circling tactics in a 2D grid (so there is no graph or nodes and implement algorithms like A*). So I am trying to make a robust multi-agent algorithm that would allow multi-agents would capture an intelligent and faster enemy agent However, the enemy agent (red) would just head towards the exit and run into the agents (blue)

Calculating weights in a NN

倖福魔咒の 提交于 2019-12-25 03:38:26
问题 So I am currently trying to implement my first NN with a genetic algorithm for training and a sigmoid activation function. It's all good but I'm not quite sure in what ranges the weights must be. I've searched some about the question but with no luck. How does one choose the ranges of the weights in a NN? What does it depend on? 回答1: The weights can be seen as an intrinsic property of the problem you're trying to solve using the GA/NN approach; there's no general best value fo these, so you

Need help on chess game evaluation function

假装没事ソ 提交于 2019-12-25 02:26:30
问题 I am developing a chess game and at the moment I'm trying to implement a minimax algorithm. I haven't done this before, also the little i known about how to programmatically represent and implement the following evaluation function features(material, mobility, piece square table, centre control, trapped piece, king safety, tempo and pawn structure) is not quite clear to me (I will be grateful if someone can explain to me in detail). I have been able to assign values to each chess pieces,

Is it possible to set a middle layer as an output layer in keras

我怕爱的太早我们不能终老 提交于 2019-12-25 01:24:30
问题 I would like to try out an idea about autoencoder. The model is like this: input (pictures) - conv2d - pooling - dense - dense(supervised output) - dense - conv - upsampling - output (pictures) If it is possible to train the NN having desired outputs for dense(supervised output) and output (pictures) ? In other words, I want to make a classifier-and-back. 回答1: This can be done with the Keras functional API (https://keras.io/getting-started/functional-api-guide/). A minimal example, where the

Width and Height of Human Body

江枫思渺然 提交于 2019-12-25 00:34:33
问题 How can I recognize the height and the width of a human body in an image? 回答1: You need some point of reference. A simple photo will not do, unless you know the camera setup (placement, zoom, lens distortion, etc.), and the location of the person relative to the camera. If you do have a reference (like a grid in the background or something) then you can measure the grid and go from there. Doesn't sound like what you need though. 回答2: To expand on what others have said, you can break down this

Get id of all intent and utterances after import

喜夏-厌秋 提交于 2019-12-24 23:42:33
问题 So have created two applications on Luis and I wanted to import second application into first application. So I did the following: Export second Application Import into first application Train first application Publish first application Now I want to get id's of trained intent and utterances but I am not able to find any Luis API to do so. Without any id's, I am not to do delete and update intent or utterances programatically. How can I get complete LUIS application details(intent,entity

What could cause this to start miscalculating after awhile?

别说谁变了你拦得住时间么 提交于 2019-12-24 16:28:43
问题 I'm trying to implement NegaMax for a game of checkers. I'm just testing it with a depth of 0 right now, meaning the current player just evaluates all his moves without regard to what the other player might do next. It works perfectly for about half the game (computes the scores correctly), and then part way through it starts spitting out non-sense answers. For example, White might have 1 piece left, and Black will have 5, but it will evaluate White's moves as a score of 7 for example, when

How is the alpha value in alpha-beta pruning algorithm used and updated?

我的梦境 提交于 2019-12-24 13:17:08
问题 I was looking at the post Strange behaviour in a function while implementing the alpha-beta pruning algorithm and the accepted answer, where it is stated: "Your rootAlphaBeta doesn't update the alpha value". I was wondering what the necessary addition to the code was. 回答1: For alpha-beta pruning to work, the alpha value needs to get propagated up to the top level of the depth first search. This can be achieved by initializing a variable to store alpha outside of the loop over the potential