Keras 層
10 個節點
本頁內容 10
相加
函數Adds several branches of the same shape, element by element, as a residual connection does.
相加(輸入: KerasTensor 陣列) -> KerasTensor
KerasTensor Add(KerasTensor[] inputs)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor 陣列 | — | The branches. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
批歸一化
函數Rescales its inputs to a steady mean and spread, batch by batch, which makes deeper networks train faster.
批歸一化(輸入: KerasTensor) -> KerasTensor
KerasTensor BatchNormalization(KerasTensor input)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
拼接
函數Joins several branches side by side, along their last axis.
拼接(輸入: KerasTensor 陣列) -> KerasTensor
KerasTensor Concatenate(KerasTensor[] inputs)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor 陣列 | — | The branches. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
二維卷積
函數A 2D convolution: small filters slid over a picture-shaped input (height, width, channels), each finding one kind of pattern.
二維卷積 -> KerasTensor
輸入: KerasTensor
濾波器數: 整數
卷積核大小: 整數
啟用函數: 文字KerasTensor Conv2D(
KerasTensor input,
int filters,
int kernelSize = 3,
string activation = "relu")參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before, shaped height, width, channels. |
| 濾波器數 | 整數 | — | How many filters, which is how many channels the output has. |
| 卷積核大小 | 整數 | 3 | Each filter's width and height in pixels. |
| 啟用函數 | 文字 | relu | relu, sigmoid...; empty for none. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
全連線層
函數A fully connected layer: every output is a weighted sum of every input, then the activation.
全連線層 -> KerasTensor
輸入: KerasTensor
單元數: 整數
啟用函數: 文字KerasTensor Dense(
KerasTensor input,
int units,
string activation)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before. |
| 單元數 | 整數 | — | How many outputs. |
| 啟用函數 | 文字 | — | relu, sigmoid, softmax, tanh, gelu...; empty for none (a linear output). |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
隨機失活
函數Drops a share of its inputs at random while training, against overfitting; does nothing when predicting.
隨機失活(輸入: KerasTensor, 比率: 數字) -> KerasTensor
KerasTensor Dropout(KerasTensor input, double rate = 0.2)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before. |
| 比率 | 數字 | 0.2 | The share dropped, between 0 and 1. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
展平
函數Lays a shaped input out as one row of numbers, as a Dense layer after convolutions needs.
展平(輸入: KerasTensor) -> KerasTensor
KerasTensor Flatten(KerasTensor input)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
輸入
函數Where data enters the network: one example's shape, without the batch.
輸入(形狀: 整數陣列, 名稱: 文字, 種子: 整數) -> KerasTensor
KerasTensor Input(int[] shape, string name, int seed = -1)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 形狀 | 整數陣列 | — | The shape of one example, such as 4 for four numbers or 28, 28, 1 for a small grey picture. |
| 名稱 | 文字 | — | A name for the input; empty for Keras's own. |
| 種子 | 整數 | -1 | The seed the starting weights of the layers drawn after this input come from, as keras.utils.set_random_seed sets it; negative leaves them random. |
返回
| 張量 | KerasTensor |
備註
Layers draw their starting weights as they are joined to the network, which happens after the Input they hang from, so seeding here makes the whole network's start repeatable.
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
層歸一化
函數Rescales each example's features to a steady mean and spread.
層歸一化(輸入: KerasTensor) -> KerasTensor
KerasTensor LayerNormalization(KerasTensor input)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習
二維最大池化
函數Halves a picture-shaped input's width and height (by default), keeping the strongest value of each patch.
二維最大池化(輸入: KerasTensor, 池化大小: 整數) -> KerasTensor
KerasTensor MaxPooling2D(KerasTensor input, int poolSize = 2)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 輸入 | KerasTensor | — | The tensor before, shaped height, width, channels. |
| 池化大小 | 整數 | 2 | The patch's width and height. |
返回
| 張量 | KerasTensor |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- Keras 層
- 所屬包
- 機器學習