python tensorflow tf.layers.max_pooling2d() 2维输入(例如图像)的最大池化层
生活随笔
收集整理的這篇文章主要介紹了
python tensorflow tf.layers.max_pooling2d() 2维输入(例如图像)的最大池化层
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
from tensorflow\python\layers\pooling.py
@tf_export('layers.max_pooling2d') def max_pooling2d(inputs,pool_size, strides,padding='valid', data_format='channels_last',name=None):"""Max pooling layer for 2D inputs (e.g. images).2D輸入(例如圖像)的最大池化層。Arguments:inputs: The tensor over which to pool. Must have rank 4.要合并(池化)的張量。 必須具有等級4。pool_size: An integer or tuple/list of 2 integers: (pool_height, pool_width)specifying the size of the pooling window.Can be a single integer to specify the same value forall spatial dimensions.一個整數(shù)或2個整數(shù)的元組/列表:(pool_height,pool_width)指定池窗口的大小。 可以是單個所有空間尺寸。strides: An integer or tuple/list of 2 integers,specifying the strides of the pooling operation.Can be a single integer to specify the same value forall spatial dimensions.一個整數(shù)或2個整數(shù)的元組/列表,指定池操作的步幅。 可以是單個整數(shù),以為所有空間尺寸指定相同的值。padding: A string. The padding method, either 'valid' or 'same'.Case-insensitive.一個字符串。 填充方法,“有效”或“相同”。 不區(qū)分大小寫。data_format: A string. The ordering of the dimensions in the inputs.`channels_last` (default) and `channels_first` are supported.`channels_last` corresponds to inputs with shape`(batch, height, width, channels)` while `channels_first` corresponds toinputs with shape `(batch, channels, height, width)`.一個字符串。 輸入中尺寸的順序。 支持`channels_last`(默認(rèn))和`channels_first`。 “ channels_last”對應(yīng)于形狀為((批,高度,寬度,通道))的輸入,而“ channels_first”對應(yīng)于形狀為((批,通道,高度,寬度)的輸入。name: A string, the name of the layer.字符串,層的名稱。Returns:Output tensor. 輸出張量。Raises:ValueError: if eager execution is enabled.ValueError:如果啟用了急切執(zhí)行。"""layer = MaxPooling2D(pool_size=pool_size, strides=strides,padding=padding, data_format=data_format,name=name)return layer.apply(inputs)總結(jié)
以上是生活随笔為你收集整理的python tensorflow tf.layers.max_pooling2d() 2维输入(例如图像)的最大池化层的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DSP与FPGA和嵌入式是什么关系?
- 下一篇: 深度学习中不变性是什么?平移不变性Tra