TensorFLow 函數(shù)翻譯 — tf.nn.dropout()

tf.nn.dropout(x, keep_prob, noise_shape=None, seed=None, name=None)###


Computes dropout.

計(jì)算dropout率。

With probability keep_prob, outputs the input element scaled up by 1 / keep_prob, otherwise outputs 0. The scaling is so that the expected sum is unchanged.

存在概率keep_prob,則輸出通過1 / keep_prob放大的輸入,否則輸出0??s放以便期望總和不變。

By default, each element is kept or dropped independently. If noise_shape is specified, it must be broadcastable to the shape of x, and only dimensions with noise_shape[i] == shape(x)[i] will make independent decisions. For example, if shape(x) = [k, l, m, n] and noise_shape = [k, 1, 1, n], each batch and channel component will be kept independently and each row and column will be kept or not kept together.

在默認(rèn)情況下,每個(gè)元素獨(dú)立安排保留或者丟棄。如果已經(jīng)指定noise_shape,則x的形狀必須為可廣播的。

Args:
x: A tensor.
keep_prob: A scalar Tensor with the same type as x. The probability that each element is kept.
noise_shape: A 1-D Tensor of type int32, representing the shape for randomly generated keep/drop flags.
seed: A Python integer. Used to create random seeds. See set_random_seed for behavior.
name: A name for this operation (optional).

參數(shù):
x: 一個(gè)張量.
keep_prob: 一個(gè)跟x有相同類型的標(biāo)量張量. 決定每個(gè)元素被保留的幾率。
noise_shape: 一個(gè)int32類型的一維張量, 表示隨機(jī)生成保留 / 丟棄 狀態(tài)的形狀。
seed: 一個(gè)Python整數(shù),用來創(chuàng)建隨機(jī)種子。可參見set_random_seed的行為.
name: 操作的名字 (可選參數(shù)).

Returns:
A Tensor of the same shape of x.

返回值:
一個(gè)形狀跟x一樣的張量.

Raises:
ValueError: If keep_prob is not in (0, 1].

可引起的錯誤:
值錯誤: 如果keep_prob不在(0, 1]之內(nèi).

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容