線性
tflearn.activations.linear (x)
f(x) = x
引數
- x:具備型態
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
。
傳回
輸入 Tensor(無變更)。
Tanh
tflearn.activations.tanh (x)
對 x
的各個元素計算雙曲正切函數。
引數
- x:具備型態
float
、double
、int32
、complex64
、int64
或qint32
的 Tensor。
傳回
如果 x.dtype != qint32
,則會傳回與 x
相同型態的 Tensor;否則回傳型態為 quint8
。
Sigmoid
tflearn.activations.sigmoid (x)
對 x
的各個元素計算 sigmoid 函數。特別地,y = 1 / (1 + exp(-x))
。
引數
- x:具備型態
float
、double
、int32
、complex64
、int64
或qint32
的 Tensor。
傳回
如果 x.dtype != qint32
,則會傳回與 x
相同型態的 Tensor;否則回傳型態為 quint8
。
Softmax
tflearn.activations.softmax (x)
計算 softmax 啟用函數。
對於每批次 i
及類別 j
,我們有
softmax[i, j] = exp(logits[i, j]) / sum(exp(logits[i]))
引數
- x:
Tensor
。其型態必須為以下其中一種:float32
、float64
。2D,形狀為[batch_size, num_classes]
。
傳回
Tensor
。其型態與 x
相同。與 x
形狀相同。
Softplus
tflearn.activations.softplus (x)
計算 softplus:log(exp(features) + 1)
。
引數
- x:
Tensor
。其型態必須為以下其中一種:float32
、float64
、int32
、int64
、uint8
、int16
、int8
、uint16
。
傳回
Tensor
。其型態與 x
相同。
Softsign
tflearn.activations.softsign (x)
計算 softsign:features / (abs(features) + 1)
。
引數
- x:
Tensor
。其型態必須為以下其中一種:float32
、float64
、int32
、int64
、uint8
、int16
、int8
、uint16
。
傳回
Tensor
。其型態與 x
相同。
ReLU
tflearn.activations.relu (x)
計算校正線性:max(features, 0)
。
引數
- x:
Tensor
。其型態必須為以下其中一種:float32
、float64
、int32
、int64
、uint8
、int16
、int8
、uint16
。
傳回
Tensor
。其型態與 x
相同。
ReLU6
tflearn.activations.relu6 (x)
計算 Rectified Linear 6:min(max(features, 0), 6)
。
引數
- x:類型為
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
。
傳回
類型與x
相同的Tensor
。
LeakyReLU
tflearn.activations.leaky_relu (x, alpha=0.1, name='LeakyReLU')
ReLU 的修改版本,導入非零梯度作為負輸入。
引數
- x:類型為
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
。 - alpha:
float
。斜率。 - name:此啟動運算功能的名稱(可選)。
傳回
類型與x
相同的Tensor
。
參考資料
Rectifier 非線性提升神經網路聲學模型,Maas 等人(2013)。
連結
http://web.stanford.edu/~awni/papers/relu_hybrid_icml2013_final.pdf
PReLU
tflearn.activations.prelu (x, channel_shared=False, weights_init='zeros', trainable=True, restore=True, reuse=False, scope=None, name='PReLU')
參數校正線性單元。
引數
- x:類型為
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
。 - channel_shared:
bool
。所有頻道共用一個權重 - weights_init:
str
。權重初始化。預設:zeros。 - trainable:
bool
。如果為 True,將可以訓練權重。 - restore:
bool
。復原 alpha 值。 - reuse:
bool
。如果為 True,且有提供『範圍』,此層變數將會被重新使用(共用)。 - name:此啟動運算功能的名稱(可選)。
屬性
- scope:
str
。此運算功能範圍。 - alphas:
Variable
。PReLU alphas。
傳回
類型與x
相同的Tensor
。
參考資料
深入精修校正器:超越人類在 ImageNet 分類上的表現。He 等人,2014。
連結
http://arxiv.org/pdf/1502.01852v1.pdf
ELU
tflearn.activations.elu (x)
指數線性單元。
引數
- x:類型為
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
傳回
tf.Tensor
的tuple
。此層推論,亦即輸出訓練和測試時間的 Tensors。
參考資料
指數線性單元的快速而精確的深度網路學習,Djork-Arné Clevert、Thomas Unterthiner、Sepp Hochreiter。2015。
連結
http://arxiv.org/abs/1511.07289
CReLU
tflearn.activations.crelu (x)
計算串聯的 ReLU。
串聯一個 ReLU,僅選擇啟動的正半部,以及一個 ReLU,僅選擇啟動的負半部。請注意,由於這項非線性,會將啟動的深度加倍。
引數
- x:具備型態
float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
。
傳回
類型與x
相同的Tensor
。
連結
https://arxiv.org/abs/1603.05201
SELU
tflearn.activations.selu (x)
規模化的指數線性單元。
引數 x:類型為float
、double
、int32
、int64
、uint8
、int16
或int8
的Tensor
參考資料
自正常化神經網路,Klambauer 等人,2017。
連結
https://arxiv.org/abs/1706.02515