Skip to main content
435 votes
3 answers
382k views

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. ...
scarecrow's user avatar
  • 6,874
11 votes
2 answers
7k views

This is my test code: from keras import layers input1 = layers.Input((2,3)) output = layers.Dense(4)(input1) print(output) The output is: <tf.Tensor 'dense_2/add:0' shape=(?, 2, 4) dtype=float32&...
yadong sun's user avatar
60 votes
4 answers
56k views

Sometimes the default standard activations like ReLU, tanh, softmax, ... and the advanced activations like LeakyReLU aren't enough. And it might also not be in keras-contrib. How do you create your ...
Martin Thoma's user avatar
57 votes
5 answers
29k views

I read all sorts of texts about it, and none seem to answer this very basic question. It's always ambiguous: In a stateful = False LSTM layer, does keras reset states after: Each sequence; or ...
Daniel Möller's user avatar
3 votes
1 answer
4k views

I am using keras and tensorflow 1.4. I want to explicitly specify which neurons are connected between two layers. Therefor I have a matrix A with ones in it, whenever neuron i in the first Layer is ...
RolleRugu's user avatar
  • 343
58 votes
10 answers
82k views

I'd like to reset (randomize) the weights of all layers in my Keras (deep learning) model. The reason is that I want to be able to train the model several times with different data splits without ...
Tor's user avatar
  • 1,108
55 votes
4 answers
132k views

I am using Windows 10, Python 3.5, and tensorflow 1.1.0. I have the following script: import tensorflow as tf import tensorflow.contrib.keras.api.keras.backend as K from tensorflow.contrib.keras.api....
Faur's user avatar
  • 6,018
38 votes
2 answers
16k views

I'm building a model that converts a string to another string using recurrent layers (GRUs). I have tried both a Dense and a TimeDistributed(Dense) layer as the last-but-one layer, but I don't ...
cseprog's user avatar
  • 587
21 votes
6 answers
57k views

I got this error message when declaring the input layer in Keras. ValueError: Negative dimension size caused by subtracting 3 from 1 for 'conv2d_2/convolution' (op: 'Conv2D') with input shapes: [?,...
Nurdin's user avatar
  • 24.1k
84 votes
4 answers
116k views

I am trying to do a transfer learning; for that purpose I want to remove the last two layers of the neural network and add another two layers. This is an example code which also output the same error. ...
Eka's user avatar
  • 15.3k
73 votes
9 answers
171k views

I want to train a deep network starting with the following layer: model = Sequential() model.add(Conv2D(32, 3, 3, input_shape=(32, 32, 3))) using history = model.fit_generator(get_training_data(), ...
Oblomov's user avatar
  • 9,765
62 votes
10 answers
149k views

Using ResNet50 pre-trained Weights I am trying to build a classifier. The code base is fully implemented in Keras high-level Tensorflow API. The complete code is posted in the below GitHub Link. ...
Madhi's user avatar
  • 1,236
100 votes
4 answers
86k views

I am using deep learning library keras and trying to stack multiple LSTM with no luck. Below is my code model = Sequential() model.add(LSTM(100,input_shape =(time_steps,vector_size))) model.add(LSTM(...
Tamim Addari's user avatar
  • 7,861
60 votes
20 answers
136k views

I am trying to run some code to create an LSTM model but i get an error: AttributeError: module 'tensorflow' has no attribute 'get_default_graph' My code is as follows: from keras.models import ...
Alice's user avatar
  • 683
51 votes
5 answers
58k views

I want to pass the output of ConvLSTM and Conv2D to a Dense Layer in Keras, what is the difference between using global average pooling and flatten Both is working in my case. model.add(ConvLSTM2D(...
user239457's user avatar
  • 1,886

15 30 50 per page
1
2 3 4 5
14