artificial-intelligence

Algorithm for selecting n vectors out of a set while minimizing cost

ⅰ亾dé卋堺 提交于 2020-01-24 06:21:08
问题 assuming we have: set U of n-dimensional vectors (vector v = < x1,x2 ... ,xn >) constraint n-dimensional vector c = < x1...xn > n-dimensional vector of weights w = < x1...xn > integer S i need algorithm that would select S vectors from U into set R while minimizing function cost(R) cost(R) = sum(abs(c-sumVectors(R))*w) (sumVectors is a function that sums all vectors like so: sumVectors({< 1,2 >; < 3 ,4>}) = < 4,6 > while sum(< 1, 2, 3 >) returns scalar 6) The solution does not have to be

Neural Network and Temporal Difference Learning

限于喜欢 提交于 2020-01-24 05:25:07
问题 I have a read few papers and lectures on temporal difference learning (some as they pertain to neural nets, such as the Sutton tutorial on TD-Gammon) but I am having a difficult time understanding the equations, which leads me to my questions. -Where does the prediction value V_t come from? And subsequently, how do we get V_(t+1)? -What exactly is getting back propagated when TD is used with a neural net? That is, where does the error that gets back propagated come from when using TD? 回答1:

How to implement an interactive decision tree in C#

寵の児 提交于 2020-01-23 02:05:07
问题 I need to allow the users choose their own path by picking between two simple choices displayed on their screen in order to progress to the next set of choices, until they get to one of the endings, i.e something like this should be achieved: I have tried the following code, but only the left side is evaluated each time. I am wondering how can I achieve a results like the above image (covering all the branches)? For instance, if the user selects "No" the application shouldn't ask any further

Neural network is not giving the expected output after training in Python

人盡茶涼 提交于 2020-01-22 20:39:31
问题 My neural network is not giving the expected output after training in Python. Is there any error in the code? Is there any way to reduce the mean squared error (MSE)? I tried to train (Run the program) the network repeatedly but it is not learning, instead it is giving the same MSE and output. Here is the Data I used: https://drive.google.com/open?id=1GLm87-5E_6YhUIPZ_CtQLV9F9wcGaTj2 Here is my code: #load and evaluate a saved model from numpy import loadtxt from tensorflow.keras.models

Is it possible for a computer to “learn” a regular expression by user-provided examples?

随声附和 提交于 2020-01-18 04:48:07
问题 Is it possible for a computer to "learn" a regular expression by user-provided examples? To clarify: I do not want to learn regular expressions. I want to create a program which "learns" a regular expression from examples which are interactively provided by a user, perhaps by selecting parts from a text or selecting begin or end markers. Is it possible? Are there algorithms, keywords, etc. which I can Google for? EDIT : Thank you for the answers, but I'm not interested in tools which provide

Is it possible for a computer to “learn” a regular expression by user-provided examples?

情到浓时终转凉″ 提交于 2020-01-18 04:47:25
问题 Is it possible for a computer to "learn" a regular expression by user-provided examples? To clarify: I do not want to learn regular expressions. I want to create a program which "learns" a regular expression from examples which are interactively provided by a user, perhaps by selecting parts from a text or selecting begin or end markers. Is it possible? Are there algorithms, keywords, etc. which I can Google for? EDIT : Thank you for the answers, but I'm not interested in tools which provide

Need to split #tags to text

偶尔善良 提交于 2020-01-17 13:46:11
问题 I Need to split #tags to meaningful words in an automated way. Sample Input: iloveusa mycrushlike mydadhero Sample Output i love usa my crush like my dad hero Any utility or open API that I can use to achieve this? 回答1: Check - Word Segmentation Task from Norvig's work. from __future__ import division from collections import Counter import re, nltk WORDS = nltk.corpus.brown.words() COUNTS = Counter(WORDS) def pdist(counter): "Make a probability distribution, given evidence from a Counter." N

How to fix AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

不打扰是莪最后的温柔 提交于 2020-01-15 10:08:47
问题 I'm trying to build an ai based chatbot based on a tutorial, they're using python 3.5 and tensorflow 1.0.0. I have crossed checked everything, my virtual environment is running from inside the anaconda explorer. I even ran it from the terminal and activated it. I'm importing everything correctly and all. Although I installed tensorflow 1.0.0 using anaconda terminal with virtual env activated, when I look it up in anacoda it says 1.1.0. I don't know if there is major difference in there or not

How to fix AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

两盒软妹~` 提交于 2020-01-15 10:06:01
问题 I'm trying to build an ai based chatbot based on a tutorial, they're using python 3.5 and tensorflow 1.0.0. I have crossed checked everything, my virtual environment is running from inside the anaconda explorer. I even ran it from the terminal and activated it. I'm importing everything correctly and all. Although I installed tensorflow 1.0.0 using anaconda terminal with virtual env activated, when I look it up in anacoda it says 1.1.0. I don't know if there is major difference in there or not

Best Data Structure for Genetic Algorithm in C++?

老子叫甜甜 提交于 2020-01-14 14:25:29
问题 i need to implement a genetic algorithm customized for my problem (college project), and the first version had it coded as an matrix of short ( bits per chromosome x size of population). That was a bad design, since i am declaring a short but only using the "0" and "1" values... but it was just a prototype and it worked as intended, and now it is time for me to develop a new, improved version. Performance is important here, but simplicity is also appreciated. I researched around and came up