python - Keras TimeDistributed - 权重共享吗?

标签 python machine-learning neural-network deep-learning keras

来自 keras docs : 然后,您可以使用 TimeDistributedDense 层独立应用于 10 个时间步长中的每一个:

# as the first layer in a model
model = Sequential()
model.add(TimeDistributed(Dense(8), input_shape=(10, 16)))
# now model.output_shape == (None, 10, 8)

# subsequent layers: no need for input_shape
model.add(TimeDistributed(Dense(32)))
# now model.output_shape == (None, 10, 32)

我在任何地方都找不到它,Dense 层的权重是否在时间轴上共享?

最佳答案

是的,它们是共享的 - 完全相同的 Dense 应用于每个 timestep。此外 - 在 Keras 2.0 中,TimeDistributed 之类的行为现在默认用于应用到超过 2D 的输入的 Dense 层(包括 batch_dimension).

关于python - Keras TimeDistributed - 权重共享吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43265084/

相关文章:

python - 我想在 python 中打印 "\"字符,但我得到 "\\"

python - 如何显示用户的错误?

matlab - 多类支持向量机。二元决策树。 LIBSVM 的问题

machine-learning - 损失和准确性-这些学习曲线是否合理?

java - 从 deeplearning4j 层提取特征

python - 在 python 中写入文本文件最后一行不起作用

python - 如何确保 pip 从内部 pypi 获取包?

TensorFlow - "TypeError: Fetch Argument None"

python - 使用 pylearn2 创建单层神经网络

machine-learning - 使用tiny-dnn 训练 CNN 获取 NIST 数字