artificial-intelligence

Looking for a way to optimize this algorithm for parsing a very large string

岁酱吖の 提交于 2019-12-11 05:26:24
问题 The following class parses through a very large string (an entire novel of text) and breaks it into consecutive 4-character strings that are stored as a Tuple. Then each tuple can be assigned a probability based on a calculation. I am using this as part of a monte carlo/ genetic algorithm to train the program to recognize a language based on syntax only (just the character transitions). I am wondering if there is a faster way of doing this. It takes about 400ms to look up the probability of

AI/Deep Learning approach to judge reference in paper?

删除回忆录丶 提交于 2019-12-11 05:08:08
问题 This is a real part of my work. In order to keep students' paper follow given format standard, I have to judge the reference type in students' papers, separate its items(author, title, magazine name, year, etc), then give modification advice if some item is missing. It is tedious, so after some years' of work-by-people, I get too tired. I think to do it by programming. In a paper, many kinds of references will be citation, for example, Journal paper, Dissertation paper, book and so on. They

Regularized cost function with very large λ

拜拜、爱过 提交于 2019-12-11 05:05:04
问题 Consider the cost function with regularization in machine learning: Why will the parameter θ towards to zero when we set the parameter λ to be very large? 回答1: The regularized cost function is penalized by the size of the parameters θ. The regularization term dominates the cost in case λ → +inf It is worth noting that when λ is very large, most of the cost will be coming from the regularization term λ * sum (θ²) and not the actual cost sum((h_θ - y)²) , hence in that case it's mostly about

object appears in multiple graph cliques

回眸只為那壹抹淺笑 提交于 2019-12-11 04:26:19
问题 I have a piece of code that supposed to find cliques of nodes, while nodes are ids of django model objects: import networkx as nx final_groups = [] graph = nx.Graph() for img_test in Same_Img_Test.objects.filter(id__in=test_ids, is_same=1): graph.add_edge(img_test.product_1.id, img_test.product_2.id) for x in nx.find_cliques(graph): final_groups.append(x) print x I get this result: [1293856L, 909760L] [1293856L, 909730L] [1293856L, 909797L] [1293856L, 909767L] [1293856L, 909741L] my question

Encog Neural Net - How to structure training data?

偶尔善良 提交于 2019-12-11 03:48:31
问题 Every example I've seen for Encog neural nets has involved XOR or something very simple. I have around 10,000 sentences and each word in the sentence has some type of tag. The input layer needs to take 2 inputs, the previous word and the current word. If there is no previous word, then the 1st input is not activated at all. I need to go through each sentence like this. Each word is contingent on the previous word, so I can't just have an array that looks similar to the XOR example.

Discord receive audio

北战南征 提交于 2019-12-11 02:33:58
问题 I want to receive Audio from Discord to make a speech recognition. I haven't found something in the python Discord APi. The speech recognition is no problem, but I have no idea how to receive Audio from Discord. Maybe someone can help me. 回答1: This functionality doesn't really exist. There is a VoiceClient.poll_voice_ws coroutine, but that just reads directly from the socket. You'll have to come up with some way of decoding that into audio and further handling it yourself. 来源: https:/

Activation Function choice for Neural network

♀尐吖头ヾ 提交于 2019-12-11 01:33:08
问题 Can we use different Activation functions for hidden layer and output layer of Neural network? Is there any explicit advantage of using such scheme? 回答1: In short - yes you can. It is a common approach to use sigmoid function as a hidden layer activation to ensure nonlinear features, and activation in the output selected for a particular task (depending on what you are trying to model, and what cost function you use). 回答2: For the last layer of the network the activation unit also depends on

All possible paths

≯℡__Kan透↙ 提交于 2019-12-11 00:58:33
问题 I am currently working on an AI for playing the game Dots (link). The objective is to remove as many dots as possible by connecting similarly colored dots with a line. I've gone through the board and grouped each set of neighboring dots with the same color. The groups all currently share the same highlight color (black). So, for example, the four red dots in the top left form a single group, as do the three yellow dots on the top right. I need to calculate every possible path through one of

Trying to implement potential field navigation in matplotlib

ぃ、小莉子 提交于 2019-12-10 23:30:10
问题 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 I am trying to make a robust multi-agent algorithm that would allow multi-agents would capture an intelligent and faster enemy agent So I attempted to give the enemy agent navigation and obstacle avoidance abilities by using something known as potential field navigation. Basically, the enemy

How to design the heuristic for A* when there are multiple goals in the grid map?

落爺英雄遲暮 提交于 2019-12-10 21:12:18
问题 I am facing a problem that I have to use A* to search through the map, and there are multiple goals in this map to reach. My aim is to expand the least nodes in the map, any idea on how to design the heuristic for this A* algorithm? thanks 回答1: Assuming by "multiple goals" you mean you want to reach any one , just take the minimum of all the heuristics. Assuming your heuristic is consistent, this is still a consistent heuristic. If instead you're trying to reach all of them , this is