Questions tagged «dimensions»

3
使用Keras了解LSTM中的input_shape参数
我正在尝试使用Keras文档中描述的名为“用于序列分类的堆叠式LSTM” 的示例(请参见下面的代码),并且无法input_shape在我的数据上下文中找出参数。 我输入了一个由25个可能的字符组成的序列矩阵,以整数编码为最大长度为31的填充序列。因此,my x_train具有形状(1085420, 31)含义(n_observations, sequence_length)。 from keras.models import Sequential from keras.layers import LSTM, Dense import numpy as np data_dim = 16 timesteps = 8 num_classes = 10 # expected input data shape: (batch_size, timesteps, data_dim) model = Sequential() model.add(LSTM(32, return_sequences=True, input_shape=(timesteps, data_dim))) # returns a sequence of vectors of …
20 lstm  keras  shape  dimensions 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.