artificial-intelligence

ImportError: cannot import name signature

故事扮演 提交于 2020-02-24 05:17:25
问题 I am tying to modify the original sklearn.CalibrationCV to create my won version. The original code has "from .utils.fixes import signature". So I did the following in my version: from sklearn.utils.fixes import signature but got a error: ImportError: cannot import name signature When check the sklearn source code on GitHub. I see the following code inside fixes.py : try: from inspect import signature except ImportError: from ..externals.funcsigs import signature Then I did from inspect

ImportError: cannot import name signature

倖福魔咒の 提交于 2020-02-24 05:17:09
问题 I am tying to modify the original sklearn.CalibrationCV to create my won version. The original code has "from .utils.fixes import signature". So I did the following in my version: from sklearn.utils.fixes import signature but got a error: ImportError: cannot import name signature When check the sklearn source code on GitHub. I see the following code inside fixes.py : try: from inspect import signature except ImportError: from ..externals.funcsigs import signature Then I did from inspect

Encog: How do I compute without ideal data?

依然范特西╮ 提交于 2020-02-23 07:41:06
问题 Here is an example of my code just to explain my question. (My code is not the XOR example and it has much more data): public static double XOR_INPUT[][] = { { 0.0, 0.0 }, { 1.0, 0.0 }, { 0.0, 1.0 }, { 1.0, 1.0 } }; public static double XOR_IDEAL[][] = { { 0.0 }, { 1.0 }, { 1.0 }, { 0.0 } }; ... MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL); ... for(MLDataPair pair: trainingSet ) { final MLData output = network.compute(pair.getInput()); System.out.println(pair.getInput()

Using Bayes formula

↘锁芯ラ 提交于 2020-02-08 10:01:43
问题 suppose the cave system contains 100 caves, of which 90 caves are without a hidden treasure and 10 caves contain a buried gold object. In 70% of the caves with a hidden treasure, the Wumpus has left behind his usual stench from digging about and bumping into walls. In the remaining caves with hidden treasures in them, the Wumpus has left no trace, i.e. they are non-smelly. Furthermore, all the caves without a hidden treasure are free from smell, since the Wumpus has fled the cave system. The

Neural Network Diverging instead of converging

若如初见. 提交于 2020-02-02 04:14:18
问题 I have implemented a neural network (using CUDA) with 2 layers. (2 Neurons per layer). I'm trying to make it learn 2 simple quadratic polynomial functions using backpropagation. But instead of converging, the it is diverging (the output is becoming infinity) Here are some more details about what I've tried: I had set the initial weights to 0, but since it was diverging I have randomized the initial weights I read that a neural network might diverge if the learning rate is too high so I

Does A* need to know the optimal solution cost while utilizing an admissible heuristic?

删除回忆录丶 提交于 2020-01-25 20:27:07
问题 I've read through a few stackoverflows on this topic, as well as the wikipedia on A* but I'm still a little confused. I think this post almost explained it completely to me: A* heuristic, overestimation/underestimation? My only confusion left is, how does the A* know the optimal solution? It seems like with an admissible heuristic, you can throw out paths that exceed the known optimal solution, because the heuristic is guaranteed to be less than or equal. But how would A* know the optimal

Transform an image of handwritten notes to text [closed]

痴心易碎 提交于 2020-01-25 08:03:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 months ago . I have hundreds of images of handwritten notes. They were written from different people but they are in sequence so you know that for example person1 wrote img1.jpg -> img100.jpg . The style of handwriting varies a lot from person to person but there are parts of the notes which

How do you unit test code that relies on randomly generated numbers?

£可爱£侵袭症+ 提交于 2020-01-24 22:11:06
问题 What is the best way to unit test code that relies on you randomly generating data? I found this question on stack overflow but it is a little different. I know that you can use fixtures to mock out something like a database but I think that what I'm trying to do is a little different. I'm trying to write an adaline neural network. This requires me to randomly generate weights and then the values for the weights are adjusted as more data is presented to the network. How do I unit test

What is used to train a self-attention mechanism?

徘徊边缘 提交于 2020-01-24 16:14:27
问题 I've been trying to understand self-attention, but everything I found doesn't explain the concept on a high level very well. Let's say we use self-attention in a NLP task, so our input is a sentence. Then self-attention can be used to measure how "important" each word in the sentence is for every other word. The problem is that I do not understand how that "importance" is measured. Important for what? What exactly is the goal vector the weights in the self-attention algorithm are trained

What does train_on_batch() do in keras model?

杀马特。学长 韩版系。学妹 提交于 2020-01-24 06:42:06
问题 I saw a sample of code (too big to paste here) where the author used model.train_on_batch(in, out) instead of model.fit(in, out) . The official documentation of Keras says: Single gradient update over one batch of samples. But I don't get it. Is it the same as fit() , but instead of doing many feed-forward and backprop steps, it does it once? Or am I wrong? 回答1: Yes, train_on_batch trains using a single batch only and once. While fit trains many batches for many epochs. (Each batch causes an