- Keras 教程
- Keras - 主頁
- Keras - 簡介
- Keras - 安裝
- Keras - 後端配置
- Keras - 深度學習概覽
- Keras - 深度學習
- Keras - 模組
- Keras - 層
- Keras - 自定義層
- Keras - 模型
- Keras - 模型編譯
- Keras - 模型評估和預測
- Keras - 卷積神經網路
- Keras - 使用 MPL 進行迴歸預測
- Keras - 使用 LSTM RNN 進行時間序列預測
- Keras - 應用程式
- Keras - 使用 ResNet 模型進行即時預測
- Keras - 預訓練模型
- Keras 有用資源
- Keras - 快速指南
- Keras - 有用資源
- Keras - 討論
Keras - 置換層
置換也用於使用模式更改輸入的形狀。例如,如果將帶有引數 (2, 1) 的 置換應用於輸入形狀為 (batch_size, 3, 2) 的層,則該層的輸出形狀將為 (batch_size, 2, 3)
置換有一個引數,如下所述 −
keras.layers.Permute(dims)
一個使用 置換 層的簡單示例如下 −
>>> from keras.models import Sequential >>> from keras.layers import Activation, Dense, Permute >>> >>> >>> model = Sequential() >>> layer_1 = Dense(16, input_shape = (8, 8)) >>> model.add(layer_1) >>> layer_2 = Permute((2, 1)) >>> model.add(layer_2) >>> layer_2.input_shape (None, 8, 16) >>> layer_2.output_shape (None, 16, 8) >>>
其中,(2, 1) 設定為模式。
廣告