keras-layer

How to use TimeDistributed layer for predicting sequences of dynamic length? PYTHON 3

孤人 提交于 2020-08-26 09:01:49
问题 So I am trying to build an LSTM based autoencoder, which I want to use for the time series data. These are spitted up to sequences of different lengths. Input to the model has thus shape [None, None, n_features], where the first None stands for number of samples and the second for time_steps of the sequence. The sequences are processed by LSTM with argument return_sequences = False, coded dimension is then recreated by function RepeatVector and ran through LSTM again. In the end I would like

what is the difference between Flatten() and GlobalAveragePooling2D() in keras

ぃ、小莉子 提交于 2020-08-21 06:05:07
问题 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(filters=256,kernel_size=(3,3))) model.add(Flatten()) # or model.add(GlobalAveragePooling2D()) model.add(Dense(256,activation='relu')) 回答1: That both seem to work doesn't mean they do the same. Flatten will take a tensor of any shape and transform it into a one dimensional tensor (plus the samples

What is the difference between MaxPool and MaxPooling layers in Keras?

让人想犯罪 __ 提交于 2020-08-07 07:56:38
问题 I just started working with Keras and noticed that there are two layers with very similar names for max pooling: MaxPool and MaxPooling . I was surprised that I couldn't find the difference between these two on Google; so I am wondering what the difference is between the two if any. 回答1: they are the same. you can test it by your own import numpy as np import tensorflow as tf from tensorflow.keras.layers import * # create dummy data X = np.random.uniform(0,1, (32,5,3)).astype(np.float32)

What is the difference between MaxPool and MaxPooling layers in Keras?

余生长醉 提交于 2020-08-07 07:56:19
问题 I just started working with Keras and noticed that there are two layers with very similar names for max pooling: MaxPool and MaxPooling . I was surprised that I couldn't find the difference between these two on Google; so I am wondering what the difference is between the two if any. 回答1: they are the same. you can test it by your own import numpy as np import tensorflow as tf from tensorflow.keras.layers import * # create dummy data X = np.random.uniform(0,1, (32,5,3)).astype(np.float32)