Skip to content

Commit

Permalink
Update pool docs. (tensorflow#1357)
Browse files Browse the repository at this point in the history
DOC
  • Loading branch information
jgartman authored and Nikhil Thorat committed Oct 29, 2018
1 parent 7aa138c commit 8dde094
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions src/ops/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ import {op} from './operation';
*
* @param x The input tensor, of rank 4 or rank 3 of shape
* `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
* @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`.
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param dilations The dilation rates: `[dilationHeight, dilationWidth]`
* in which we sample input values across the height and width dimensions
* in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single
Expand All @@ -47,7 +49,6 @@ import {op} from './operation';
* dimensions if pad is a number. If none is provided, it will not round
* and error if the output is of fractional size.
*/
/** @doc {heading: 'Operations', subheading: 'Convolution'} */
function maxPoolImpl_<T extends Tensor3D|Tensor4D>(
x: T|TensorLike, filterSize: [number, number]|number,
strides: [number, number]|number, dilations: [number, number]|number,
Expand Down Expand Up @@ -100,8 +101,10 @@ function maxPoolImpl_<T extends Tensor3D|Tensor4D>(
*
* @param x The input tensor, of rank 4 or rank 3 of shape
* `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
* @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`.
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param pad The type of padding algorithm.
* - `same` and stride 1: output will be of same size as input,
* regardless of filter size.
Expand All @@ -127,8 +130,10 @@ function maxPool_<T extends Tensor3D|Tensor4D>(
*
* @param x The input tensor, of rank 4 or rank 3 of shape
* `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
* @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`.
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param dilations The dilation rates: `[dilationHeight, dilationWidth]`
* in which we sample input values across the height and width dimensions
* in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single
Expand All @@ -146,7 +151,6 @@ function maxPool_<T extends Tensor3D|Tensor4D>(
* dimensions if pad is a number. If none is provided, it will not round
* and error if the output is of fractional size.
*/
/** @doc {heading: 'Operations', subheading: 'Convolution'} */
function avgPoolImpl_<T extends Tensor3D|Tensor4D>(
x: T|TensorLike, filterSize: [number, number]|number,
strides: [number, number]|number, dilations: [number, number]|number,
Expand Down Expand Up @@ -199,8 +203,10 @@ function avgPoolImpl_<T extends Tensor3D|Tensor4D>(
*
* @param x The input tensor, of rank 4 or rank 3 of shape
* `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
* @param filterSize The filter size, a tuple `[filterHeight, filterWidth]`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`.
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param pad The type of padding algorithm:
* - `same` and stride 1: output will be of same size as input,
* regardless of filter size.
Expand All @@ -222,11 +228,12 @@ function avgPool_<T extends Tensor3D|Tensor4D>(
}

/**
* Computes the 2D average pooling of an image.
* Performs an N-D pooling operation
*
* @param input The input tensor, of rank 4 or rank 3 of shape
* `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
* @param windowShape The filter size, a tuple `[filterHeight, filterWidth]`.
* @param windowShape The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param poolingType The type of pooling, either 'max' or 'avg'.
* @param pad The type of padding algorithm:
* - `same` and stride 1: output will be of same size as input,
Expand All @@ -236,13 +243,15 @@ function avgPool_<T extends Tensor3D|Tensor4D>(
* - For more info, see this guide:
* [https://www.tensorflow.org/api_guides/python/nn#Convolution](
* https://www.tensorflow.org/api_guides/python/nn#Convolution)
* @param dilations The dilation rates: `[dilationHeight, dilationWidth]`
* @param dilationRate The dilation rates: `[dilationHeight, dilationWidth]`
* in which we sample input values across the height and width dimensions
* in dilated pooling. Defaults to `[1, 1]`. If `dilations` is a single
* in dilated pooling. Defaults to `[1, 1]`. If `dilationRate` is a single
* number, then `dilationHeight == dilationWidth`. If it is greater than
* 1, then all values of `strides` must be 1.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
*/
/** @doc {heading: 'Operations', subheading: 'Convolution'} */
function pool_<T extends Tensor3D|Tensor4D>(
input: T|TensorLike, windowShape: [number, number]|number,
poolingType: 'avg'|'max', padding: 'valid'|'same'|number,
Expand Down Expand Up @@ -270,8 +279,10 @@ function pool_<T extends Tensor3D|Tensor4D>(
* [batchSize, height, width, channels].
* @param output The original output image, of rank 4, of shape
* [batchSize, outHeight, outWidth, channels].
* @param filterSize The filter size, a tuple [filterHeight, filterWidth].
* @param strides The strides of the pooling: [strideHeight, strideWidth].
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param pad A string from: 'same', 'valid'. The type of padding algorithm
* used in the forward prop of the op.
* @param dimRoundingMode A string from: 'ceil', 'round', 'floor'. The
Expand Down Expand Up @@ -331,8 +342,10 @@ function maxPoolBackprop(
* @param input The input image, of rank 4 or rank 3 of shape
* [batchSize, height, width, channels]. If rank 3, batch of 1 is
* assumed.
* @param filterSize The filter size, a tuple [filterHeight, filterWidth].
* @param strides The strides of the pooling: [strideHeight, strideWidth].
* @param filterSize The filter size: `[filterHeight, filterWidth]`. If
* `filterSize` is a single number, then `filterHeight == filterWidth`.
* @param strides The strides of the pooling: `[strideHeight, strideWidth]`. If
* `strides` is a single number, then `strideHeight == strideWidth`.
* @param pad A string from: 'same', 'valid'. The type of padding algorithm
* used in the forward prop of the op.
*/
Expand Down

0 comments on commit 8dde094

Please sign in to comment.