artificial-intelligence

Strange behaviour in a function while implementing the alpha-beta pruning algorithm

依然范特西╮ 提交于 2019-12-01 07:15:30
I've implemented a minimax algorithm with alpha-beta pruning. In order to get the best move, I call the alpha-beta algorithm with the rootAlphaBeta function. However, in the rootAlphaBeta function, I spotted some very strange behaviour. When I call the rootAlphaBeta function with a ply of 4, it makes about 20 000 calls, but when I call the alphaBeta function directly, it makes only about 2000 calls. I can't seem to find what's the problem, as the number of calls should be the same. The move that both algorithms eventually find should be the same, right? I think so, at least the score of the

Extracting pure content / text from HTML Pages by excluding navigation and chrome content

眉间皱痕 提交于 2019-12-01 07:02:16
I am crawling news websites and want to extract News Title, News Abstract (First Paragraph), etc I plugged into the webkit parser code to easily navigate webpage as a tree. To eliminate navigation and other non news content I take the text version of the article (minus the html tags, webkit provides api for the same). Then I run the diff algorithm comparing various article's text from same website this results in similar text being eliminated. This gives me content minus the common navigation content etc. Despite the above approach I am still getting quite some junk in my final text. This

Fastest way to store a numpy array in redis

坚强是说给别人听的谎言 提交于 2019-12-01 06:30:45
I'm using redis on an AI project. The idea is to have multiple environment simulators running policies on a lot of cpu cores. The simulators write experience (a list of state/action/reward tuples) to a redis server (replay buffer). Then a training process reads the experience as a dataset to generate a new policy. New policy is deployed to the simulators, data from previous run is deleted, and the process continues. The bulk of the experience is captured in the "state". Which is normally represented as a large numpy array of dimension say, 80 x 80. The simulators generate these as fast as the

Strange behaviour in a function while implementing the alpha-beta pruning algorithm

China☆狼群 提交于 2019-12-01 04:21:29
问题 I've implemented a minimax algorithm with alpha-beta pruning. In order to get the best move, I call the alpha-beta algorithm with the rootAlphaBeta function. However, in the rootAlphaBeta function, I spotted some very strange behaviour. When I call the rootAlphaBeta function with a ply of 4, it makes about 20 000 calls, but when I call the alphaBeta function directly, it makes only about 2000 calls. I can't seem to find what's the problem, as the number of calls should be the same. The move

Extracting pure content / text from HTML Pages by excluding navigation and chrome content

落爺英雄遲暮 提交于 2019-12-01 04:16:21
问题 I am crawling news websites and want to extract News Title, News Abstract (First Paragraph), etc I plugged into the webkit parser code to easily navigate webpage as a tree. To eliminate navigation and other non news content I take the text version of the article (minus the html tags, webkit provides api for the same). Then I run the diff algorithm comparing various article's text from same website this results in similar text being eliminated. This gives me content minus the common navigation

Fastest way to store a numpy array in redis

情到浓时终转凉″ 提交于 2019-12-01 04:08:14
问题 I'm using redis on an AI project. The idea is to have multiple environment simulators running policies on a lot of cpu cores. The simulators write experience (a list of state/action/reward tuples) to a redis server (replay buffer). Then a training process reads the experience as a dataset to generate a new policy. New policy is deployed to the simulators, data from previous run is deleted, and the process continues. The bulk of the experience is captured in the "state". Which is normally

Effects of randomizing the order of inputs to a neural network

风格不统一 提交于 2019-12-01 03:55:39
问题 For my Advanced Algorithms and Data Structures class, my professor asked us to pick any topic that interested us. He also told us to research it and to try and implement a solution in it. I chose Neural Networks because it's something that I've wanted to learn for a long time. I've been able to implement an AND, OR, and XOR using a neural network whose neurons use a step function for the activator. After that I tried to implement a back-propagating neural network that learns to recognize the

How to determine subject, object and other words?

◇◆丶佛笑我妖孽 提交于 2019-12-01 03:38:35
I'm trying to implement application that can determine meaning of sentence, by dividing it to smaller pieces. So I need to know what words are subject, object etc. so that my program can know how to handle this sentence. This is an open research problem. You can get an overview on Wikipedia, http://en.wikipedia.org/wiki/Natural_language_processing . Consider phrases like "Time flies like an arrow, fruit flies like a banana" - unambiguously classifying words is not easy. You should look at the Natural Language Toolkit , which is for exactly this sort of thing. See this section of the manual:

Iterative deepening in common lisp

白昼怎懂夜的黑 提交于 2019-12-01 03:24:24
问题 I've written an iterative deepening algorithm, it works except when I add cycle checking, the algorithm returns a deeper solution than it should. But when I don't check for cycles it does work correctly, but it takes too long. Can anyone please spot the bug? (defun rec-depth-limited (problem node cutoff closed) (if (= cutoff 0) (if (funcall (problem-goalp problem) node) node) (if (visited-p node closed) nil (progn ;; when i remove the next line, it works correctly (setf (gethash (node-state

Unbounded increase in Q-Value, consequence of recurrent reward after repeating the same action in Q-Learning

元气小坏坏 提交于 2019-12-01 02:56:54
问题 I'm in the process of development of a simple Q-Learning implementation over a trivial application, but there's something that keeps puzzling me. Let's consider the standard formulation of Q-Learning Q(S, A) = Q(S, A) + alpha * [R + MaxQ(S', A') - Q(S, A)] Let's assume there's this state K that has two possible actions, both awarding our agent rewards R and R' by A and A' . If we follow an almost-totally-greedy approach (let's say we assume a 0.1 epsilon), I'll at first randomly choose one of