Hot answers tagged

31

Keras is a simple and high-level neural networks library, written in Python, that works as a wrapper for Tensorflow and Theano. It's easy to learn and use. Using Keras is like working with Lego blocks. It was built so that people can do quick experiments and proofs-of-concept before launching into a full-scale build process. With that in mind, it was made ...


7

From nvidia www (https://developer.nvidia.com/discover/lstm): Accelerating Long Short-Term Memory using GPUs The parallel processing capabilities of GPUs can accelerate the LSTM training and inference processes. GPUs are the de-facto standard for LSTM usage and deliver a 6x speedup during training and 140x higher throughput during inference when compared ...


4

It actually depends on a couple of things here - How many output classes do you have? If you have only 2 or 3 classes, it is a very easy task for the classifier that you have built. So, it is highly possible that convergence has occurred. As @Djib2011 mentioned already, if your input training set is not balanced and is heavier with one of the output classes ...


3

I found that there are cuDNN accelerated cells in Keras for example: https://keras.io/layers/recurrent/#cudnnlstm They very fast. The normal LSTM cells are faster on CPU then on GPU. Also see here for a comparisem: https://wiki.eniak.de/ml/geschwindigkeitsvergleich_keras_lstm_und_cudnnlstm


3

No, Neural Networks do not have such a guarantee. In fact, I don't believe any kind of classifier in the entire field of Machine Learning has such a guarantee, though some may be slipping my mind... For an easy counterexample, consider what happens if you have two instances with precisely identical inputs, but different output labels. If your classifier is ...


3

The inputs that you describe seem like they should be sufficient for a DQN-based agent to learn a good strategy for playing Minesweeper, regardless of whether or not the starting layout changes. The inputs contain all information that is necessary. However, the problem certainly becomes much easier (probably too easy) if the initial problem is always the ...


2

input. rather than concatenating four consecutive frames, try using the difference between two consecutive frames as input. network architecture. a vanilla multi layer net will work better than a convnet in this case. you dont really need spatial/translational invariance for pong, especially if you use frame differences as input.


2

I am new to AI but this is something I can think of. There might be other much better ways. Or even functions in scikit learn to do it 1) create a list of all the 22 models 2) iterate over the models one by one and use model.predict() for each model and store the hotencoded output to another list or numpy array. 3) Take average of the output list or ...


2

I have found a hack to integrate keras with tensorflow object detection API. This hack works if you have trained the keras classification model with tensorflow backend. If above is the case you can extend the classification model to a object detection model by first converting the keras checkpoint to a tensorflow checkpoint then in the object detection API ...


2

I think it is not a very good idea because Im pretty sure you used for learning all these 22 CNN same images and even same way for giving them a batches of images. So basically in a result you would have almost the same 22 classifiers.


2

Why would giving my AI more data make it perform worse? A lot of possible reasons: In forecasting, you could have a seasonality. If you have it exactly 3 times, then it is good. If you have it 3.5 times, it becomes worse because it overfits on the months which occur more often than the others. Data quality: In practice, improving the quality of data often ...


2

There are many ways of constraining the network's output. Using an activation layer is a good one. If you sigmoid the output layer, the output is constrained between [0,1] and you can multiply that by 180 to adapt to your output. Since the layer is part of the optimization process, gradients will be learned correctly. However, there are a few issues with ...


2

After training, all standard models are deterministic (the process each input goes thru is set). In essence, during training the model attempts to learn the distribution of the training dataset. Whether it is able to depends on the size of the model, if it is big enough, it can simply "memorize" all the training samples and result in perfect accuracy on ...


2

It depends on the number of classes; we are getting good results with about 40 training examples per class. A good way to get an idea about this is to run a test with an increasing set of training data, evaluating the result as you go along. Obviously, with a small set (eg 3 sentences per class), it will be very poor, but the accuracy should quickly ...


2

Your question is really broad.. But there are many manuals and tutorials which describe how to do it step by step. My personal favorite would be: Practical Text Classification With Python and Keras - It has a very detailed explanation of every step of the implementation while remaining practical. You can also try: A Word2Vec Keras tutorial - This one ...


2

First, I assume you've tuned your hyperparameters. Because, instead of re-train the network (use the weights that resulted from the previously training process) that needs more times, I'll invest more on hyperparameters tuning of the available network. Then, there are several methods and considerations: You can use the weight resulted from your first ...


2

Ok, I made a dumb mistake. Please disregard the above panicked ranting. In case anyone else bumps up against something like this however, the issue was resolved just by remembering to clear my session at the end of each run: from keras import backend as K ...code... K.clear_session()


2

A video attention model isn't only detecting the image itself, but it simulates the movement of the human eye on a given picture. It can't be realized as a technical algorithm alone but has to implemented as a cognitive model because the common goal is to replicate human eye movements. Creating a video attention model is usually done with the help of an eye‐...


2

This is probably the most major factor: model.compile(loss='categorical_crossentropy', optimizer='adam') you have set the loss function for a multiclass classifier. It is going to have some weird results when values - either predicted or target - are outside of range 0..1 You should use this instead: model.compile(loss='mean_squared_error', optimizer='...


2

You can try using a multi-input model. Here is a recent post with a similar discussion, with the required architecture defined in the answer. Instead of combining the separate models, you can create a model which uses image and numerical data side by side. Keras allows you to use different types of data using multi input structure via functional API. And ...


2

I try to answer the things I know for sure: One effect of bigger images is the increasing computation time due to more pixels (input to your training) 4.Grayscaling reduces the information, which might decrease training time, but also model performance (accuracy, precision, recall). What I have seen is that grayscaling is used in for example face detection ...


1

The answer (as detailed quite thoroughly here and here) is that specifying model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy']) causes keras to guess, incorrectly, that because I am using binary_crossentropy for the loss function, that I would want to use binary_accuracy as the way of reporting the accuracy metrics. ...


1

I modified your example to get it to converge. The following changes were made: Use softmax as the activation of your output layer, not relu. Using relu caused nan results. The loss categorical_crossentropy expects a probability distribution, which softmax produces, not relu. Normalize the image values to be between 0 and 1. Not normalizing causes the ...


1

The probability map / output isn't produced by your loss function, but your output layer, which is activated either by softmax or sigmoid. In other words, your dice loss output is also a probability map. It's simply very confident in itself. If you forget about the problem with potential overfitting for a moment and train your binary crossentropy model ...


1

Keras/Tensorflow are mostly used of developing/training/deploying neural networks. For descision making problems, if you want to use machine learning, reinforcement learning is in most cases applied. Some reinforcement learning methods use neural networks (and therfore tensorflow) internally. You can check baseline implementations of different methods here. ...


1

Create list of labels ["dog", "cat"] and use argmax as index to get value from list.


1

You can use the argmax function to get the class labels. Please refer to this link for more information. Hope this answers your question.


1

I think instead of: if np.argmax(act_values[0]) in actions_allowed: return np.argmax(act_values[0]) you can use something like: if np.argmax(actions_allowed_values[0]): return np.argmax(actions_allowed_values[0]) So you didn't random your act if the best action is not allowed, but you choose the best action that allowed. You can do that ...


1

I had a similar problem with a 2D convolution on a hexagonal grid while working on a diffusion problem and stumbled upon this question. Rather than using cube coordinates, you could use doubled coordinates, which I found much easier to save in a 2D array. An example kernel that only changes the direct neighbours and the cell itself would be this kernel = ...


1

This should be possible, but it's not completely clear what you are trying to do. If you're trying to predict customer age and gender from a video, then you've got a computer vision problem. Deep learning methods are the state of the art for this, and probably some sort of convolutional deep neural network is your friend. If you're trying to predict ...


Only top voted, non community-wiki answers of a minimum length are eligible