Permute
类tf_keras.layers.Permute(dims, **kwargs)
根据给定的模式置换输入的维度。
例如,连接 RNN 和卷积网络时很有用。
示例
model = Sequential()
model.add(Permute((2, 1), input_shape=(10, 64)))
# now: model.output_shape == (None, 64, 10)
# note: `None` is the batch dimension
参数
(2, 1)
会置换输入的第一和第二维度。输入形状
任意。当将此层用作模型中的第一层时,请使用关键字参数 input_shape
(整数元组,不包括样本轴)。
输出形状
与输入形状相同,但维度根据指定的模式重新排序。