2,206 questions
409
votes
4
answers
89k
views
Understanding Keras Long Short Term Memories (LSTMs) [closed]
While trying to reconcile my understanding of LSTMs pointed out here in this post by Christopher Olah implemented in Keras and following the blog written by Jason Brownlee for the Keras tutorial, I am ...
235
votes
13
answers
327k
views
Keras, How to get the output of each layer?
I have trained a binary classification model with CNN, and here is my code
model = Sequential()
model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1],
border_mode=...
435
votes
3
answers
382k
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.
...
221
votes
12
answers
257k
views
Why binary_crossentropy and categorical_crossentropy give different performances for the same problem?
I'm trying to train a CNN to categorize text by topic. When I use binary cross-entropy I get ~80% accuracy, with categorical cross-entropy I get ~50% accuracy.
I don't understand why this is. It's a ...
35
votes
1
answer
27k
views
A guide to convert_imageset.cpp
I am relatively new to machine learning/python/ubuntu.
I have a set of images in .jpg format where half contain a feature I want caffe to learn and half don't. I'm having trouble in finding a way to ...
58
votes
2
answers
30k
views
How to make a custom activation function with only Python in Tensorflow?
Suppose you need to make an activation function which is not possible using only pre-defined tensorflow building-blocks, what can you do?
So in Tensorflow it is possible to make your own activation ...
446
votes
16
answers
448k
views
What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?
In my opinion, 'VALID' means there will be no zero padding outside the edges when we do max pool.
...
401
votes
11
answers
469k
views
How do I save a trained model in PyTorch?
How do I save a trained model in PyTorch? I have read that:
torch.save()/torch.load() is for saving/loading a serializable object.
model.state_dict()/model.load_state_dict() is for saving/loading ...
12
votes
4
answers
11k
views
Test labels for regression caffe, float not allowed?
I am doing regression using caffe, and my test.txt and train.txt files are like this:
/home/foo/caffe/data/finetune/flickr/3860781056.jpg 2.0
/home/foo/caffe/data/finetune/flickr/4559004485.jpg 3.6 ...
101
votes
6
answers
62k
views
Using a pre-trained word embedding (word2vec or Glove) in TensorFlow
I've recently reviewed an interesting implementation for convolutional text classification. However all TensorFlow code I've reviewed uses a random (not pre-trained) embedding vectors like the ...
21
votes
2
answers
17k
views
Keras : How should I prepare input data for RNN?
I'm having trouble with preparing input data for RNN on Keras.
Currently, my training data dimension is: (6752, 600, 13)
6752: number of training data
600: number of time steps
13: size of feature ...
21
votes
3
answers
8k
views
What is a `"Python"` layer in caffe?
Caffe has a layer type "Python".
For instance, this layer type can be used as a loss layer.
On other occasions it is used as an input layer.
What is this layer type?
How can this layer be used?
134
votes
9
answers
92k
views
Common causes of nans during training of neural networks
I've noticed that a frequent occurrence during training is NANs being introduced.
Often times it seems to be introduced by weights in inner-product/fully-connected or convolution layers blowing up.
...
162
votes
2
answers
84k
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 Karpathy
Now I ...
122
votes
8
answers
103k
views
How to apply gradient clipping in TensorFlow?
Considering the example code.
I would like to know How to apply gradient clipping on this network on the RNN where there is a possibility of exploding gradients.
tf.clip_by_value(t, clip_value_min, ...