W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
tf.nn.pool(
input,
window_shape,
pooling_type,
padding,
dilation_rate=None,
strides=None,
name=None,
data_format=None
)
定義在:tensorflow/python/ops/nn_ops.py.
請參閱指南:神經(jīng)網(wǎng)絡(luò)>池操作
執(zhí)行N-D池操作.
在data_format不以“NC”開頭的情況下,計算0 <= b <batch_size,0 <= x [i] <output_spatial_shape [i],0 <= c <num_channels:
output[b, x[0], ..., x[N-1], c] =
REDUCE_{z[0], ..., z[N-1]}
input[b,
x[0] * strides[0] - pad_before[0] + dilation_rate[0]*z[0],
...
x[N-1]*strides[N-1] - pad_before[N-1] + dilation_rate[N-1]*z[N-1],
c],
其中,還原函數(shù)REDUCE取決于pooling_type的值,并且pad_before是根據(jù)此處注釋中描述的padding的值定義的.減少從不包括越界位置.
在data_format以“NC”開頭的情況下,輸入和輸出簡單地轉(zhuǎn)置如下:
pool(input, data_format, **kwargs) =
tf.transpose(pool(tf.transpose(input, [0] + range(2,N+2) + [1]),
**kwargs),
[0, N+1] + range(1, N+1))
參數(shù):
返回:
秩為N + 2的張量,如果data_format為None或者不以“NC”開頭,則shape為[batch_size] + output_spatial_shape + [num_channels],或者如果data_format以“NC”開頭,則shape為
[batch_size,num_channels] + output_spatial_shape,其中output_spatial_shape取決于填充的值:
可能引發(fā)的異常:
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: