artificial-intelligence

Keras plot_model not showing the input layer appropriately

╄→гoц情女王★ 提交于 2019-11-28 12:20:00
My model is defined as such: model = keras.models.Sequential() model.add(layers.Embedding(max_features, 128, input_length=max_len, input_shape=(max_len,), name='embed')) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.MaxPooling1D(5)) model.add(layers.Conv1D(32, 7, activation='relu')) model.add(layers.GlobalMaxPooling1D()) model.add(layers.Dense(1)) and when I use the plot_model function to draw it out: from keras.utils import plot_model plot_model(model, show_shapes=True, to_file='model.png') The drawing I get is Where the input layer is a series of numbers. Does anybody

Which language should I use?

我怕爱的太早我们不能终老 提交于 2019-11-28 11:33:17
I'm about to produce a prototype for a technology startup that I've just joined, and I'm trying to decide which language to use. It's going to be a simple web tool with a MySQL database in the background and some AI stuff going on in between. I've used Ruby and PHP a reasonable amount in the past, but wonder whether I might be better off going with Python or even Perl. My main programming experience is with C / C++ / Java, but I feel like I want to go for something that will make my life as easy as possible since I'm just developing a prototype. I guess what I'm looking for is: speed of

How to code simple AI for a windows phone board game?

泪湿孤枕 提交于 2019-11-28 11:30:36
问题 Something like this: I am not sure how to code for this as I have only coded non-game apps. For instance how do you determine the best move after the player has made his move? I don't need the perfect moves, just challenging enough. I don't know if I have to scan all the possible moves, etc. In a game like shown in the pic, the number of possible moves are very limited, right? So I could calculate them all. But I am not sure which one would be a better move, etc. 回答1: In a small, simple game

Generating non-uniform random numbers [closed]

◇◆丶佛笑我妖孽 提交于 2019-11-28 11:23:26
Can you tell me any ways to generate non-uniform random numbers? I am using Java but the code examples can be in whatever you want. One way is to create a skewed distribution by adding two uniform random numbers together (i.e. rolling 2 dice). What distribution of deviates do you want? Here is a technique which always works, but isn't always the most efficient. The cumulative distrubtion function P(x) gives the fraction of the time that values fall below x. Thus P(x)=0 at the lowest possible value of x and P(x)=1 at the highest possible value of x. Every distribution has a unique CDF, which

Tensorflow TypeError: Fetch argument None has invalid type <type 'NoneType'>?

岁酱吖の 提交于 2019-11-28 10:46:57
I'm building a RNN loosely based on the TensorFlow tutorial . The relevant parts of my model are as follows: input_sequence = tf.placeholder(tf.float32, [BATCH_SIZE, TIME_STEPS, PIXEL_COUNT + AUX_INPUTS]) output_actual = tf.placeholder(tf.float32, [BATCH_SIZE, OUTPUT_SIZE]) lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(CELL_SIZE, state_is_tuple=False) stacked_lstm = tf.nn.rnn_cell.MultiRNNCell([lstm_cell] * CELL_LAYERS, state_is_tuple=False) initial_state = state = stacked_lstm.zero_state(BATCH_SIZE, tf.float32) outputs = [] with tf.variable_scope("LSTM"): for step in xrange(TIME_STEPS): if step >

Is there any self-improving compiler around?

喜你入骨 提交于 2019-11-28 08:25:33
I am not aware of any self-improving compiler, but then again I am not much of a compiler-guy. Is there ANY self-improving compiler out there? Please note that I am talking about a compiler that improves itself - not a compiler that improves the code it compiles . Any pointers appreciated! Side-note : in case you're wondering why I am asking have a look at this post . Even if I agree with most of the arguments I am not too sure about the following: We have programs that can improve their code without human input now — they’re called compilers. ... hence my question. While it is true that

2d trilateration

此生再无相见时 提交于 2019-11-28 07:05:31
I am writing some code to participate in an AI challenge. The main objective for the AI challenge is to take a simulated robot and navigate it through a maze to a destination zone. The secondary objective which is optional is to find a recharger placed in the maze at an unknown location. This is all done in a 2D grid. My program can call a method to get a distance measurement from the recharger. So using trilateration I should be able to locate the recharger by calling this method, recording my ai's current position and the distance the recharger is away from that point 3 times over. I found

Consistent and Admissible Heuristics

社会主义新天地 提交于 2019-11-28 06:46:15
Any consistent heuristic is also admissible. But when is a heuristic admissible but not consistent (monotone)? Please provide an example in which this is the case. As Russel and Norvig point out in Artificial Intelligence: A Modern Approach (the most commonly used AI textbook) it is challenging to come up with a heuristic that is admissible but not consistent. Obviously, you can select values for nodes in a graph such that the heuristic they represent is admissible but not consistent. This paper by Felner et al has a nice example of the two ways that this is possible, but it's a little dense,

Training feedforward neural network for OCR [closed]

允我心安 提交于 2019-11-28 06:03:44
Currently I'm learning about neural networks and I'm trying to create an application that can be trained to recognize handwritten characters. For this problem I use a feed-forward neural network and it seems to work when I train it to recognize 1, 2 or 3 different characters. But when I try to make the network learn more than 3 characters it will stagnate at a error percentage around the 40 - 60%. I tried with multiple layers and less/more neurons but I can't seem to get it right, now I'm wondering if a feedforward neural network is capable of recognizing that much information. Some statistics

How to choose number of hidden layers and nodes in neural network? [closed]

纵饮孤独 提交于 2019-11-28 03:35:00
What does number of hidden layers in a multilayer perceptron neural network do to the way neural network behaves? Same question for number of nodes in hidden layers? Let's say I want to use a neural network for hand written character recognition. In this case I put pixel colour intensity values as input nodes, and character classes as output nodes. How would I choose number of hidden layers and nodes to solve such problem? Note: this answer was correct at the time it was made, but has since become outdated. It is rare to have more than two hidden layers in a neural network. The number of