Join us in building a kind, collaborative learning community via our updatedCode of Conduct.

Questions tagged [keras]

Keras is a minimalist, highly modular neural network library providing a high-level Python API that allows for rapid prototyping, and allows the use of one of several computational back-ends.

150
votes
3answers
16k views

Understanding Keras LSTMs

I am trying to reconcile my understand of LSTMs and pointed out here: http://colah.github.io/posts/2015-08-Understanding-LSTMs/ with the LSTM implemented in Keras. I am following the blog written http:...
81
votes
8answers
50k views

How do I use the Tensorboard callback of Keras?

I have built a neural network with Keras. I would visualize its data by Tensorboard, therefore I have utilized:keras.callbacks.TensorBoard(log_dir='/Graph', histogram_freq=0,...
78
votes
6answers
68k views

Where do I call the BatchNormalization function in Keras?

If I want to use the BatchNormalization function in Keras, then do I need to call it once only at the beginning?I read this documentation for it: http://keras.io/layers/normalization/I don't see ...
70
votes
3answers
21k views

What is an Embedding in Keras?

Keras documentation isn't clear what this actually is. I understand we can use this to compress the input feature space into a smaller one. But how is this done from a neural design perspective? Is it ...
59
votes
5answers
127k views

How do I install Keras and Theano in Anaconda Python on Windows?

I am trying to work on neural networks in Python using the following Keras packages:from keras.utils import np_utilsfrom keras.layers.core import Dense, Activation, Dropoutfrom keras.models import ...
53
votes
2answers
19k views

Keras input explanation: input_shape, units, batch_size, dim, etc

For any keras layer (Layer class), can someone explain how to understand the difference between input_shape, units, dim, etc.? For example the doc says units specify the output shape of a layer. Say ...
49
votes
7answers
51k views

Keras binary_crossentropy vs categorical_crossentropy performance?

I'm trying to train a CNN to categorize text by topic. When I use binary_crossentropy I get ~80% acc, with categorical_crossentrop I get ~50% acc.I don't understand why this is. It's a multiclass ...
48
votes
1answer
12k views

Many to one and many to many LSTM examples in Keras

I try to understand LSTMs and how to build them with Keras. I found out, that there are principally the 4 modes to run a RNN (the 4 right ones in the picture)Image source: Andrej KarpathyNow I ...
46
votes
3answers
27k views

How to tell Keras stop training based on loss value?

Currently I use the following code:callbacks=[EarlyStopping(monitor='val_loss', patience=2, verbose=0),ModelCheckpoint(kfold_weights_path, monitor='val_loss', save_best_only=True, ...
44
votes
6answers
48k views

Can Keras with Tensorflow backend be forced to use CPU or GPU at will?

I have Keras installed with the Tensorflow backend and CUDA. I'd like to sometimes on demand force Keras to use CPU. Can this be done without say installing a separate CPU-only Tensorflow in a ...
44
votes
5answers
8k views

How to get reproducible results in keras

I get different results (test accuracy) every time I run the imdb_lstm.py example from Keras framework (https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py)The code contains np.random....
43
votes
6answers
43k views

Keras, How to get the output of each layer?

I have trained a binary classification model with CNN, and here is my codemodel=Sequential()model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1],border_mode=...
42
votes
6answers
62k views

Using Keras & Tensorflow with AMD GPU

I'm starting to learn Keras, which I believe is a layer on top of Tensorflow and Theano. However, I only have access to AMD GPUs such as the AMD R9 280X.How can I setup my Python environment such ...
40
votes
2answers
37k views

How to concatenate two layers in keras?

I have an example of a neural network with two layers. The first layer takes two arguments and has one output. The second should take one argument as result of the first layer and one additional ...
37
votes
4answers
56k views

Keras, how do I predict after I trained a model?

I'm playing with the reuters-example dataset and it runs fine (my model is trained). I read about how to save a model, so I could load it later to use again. But how do I use this saved model to ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,