Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
Update LRN docs to reflect removal of 'normRegion' argument (#1073)
Browse files Browse the repository at this point in the history
DOC
  • Loading branch information
jgartman authored and Nikhil Thorat committed Jun 6, 2018
1 parent 78850e1 commit abcd97b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/ops/lrn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,25 @@ export class LRNOps {
* @param x The input tensor. The 4-D input tensor is treated as a 3-D array
* of 1D vectors (along the last dimension), and each vector is
* normalized independently.
* @param radius The number of adjacent channels or spatial locations of the
* 1D normalization window. In Tensorflow this param is called
* 'depth_radius' because only 'acrossChannels' mode is supported.
* @param depthRadius The number of adjacent channels in the 1D normalization
* window.
* @param bias A constant bias term for the basis.
* @param alpha A scale factor, usually positive.
* @param beta An exponent.
*/
@doc({heading: 'Operations', subheading: 'Normalization'})
@operation
static localResponseNormalization<T extends Tensor3D|Tensor4D>(
x: T, radius = 5, bias = 1, alpha = 1, beta = 0.5): T {
x: T, depthRadius = 5, bias = 1, alpha = 1, beta = 0.5): T {
util.assertArgumentsAreTensors({x}, 'localResponseNormalization');
util.assert(
x.rank === 4 || x.rank === 3,
`Error in localResponseNormalization: x must be rank 3 or 4 but got
rank ${x.rank}.`);
util.assert(
util.isInt(radius),
`Error in localResponseNormalization3D: radius must be an integer
but got radius ${radius}.`);
util.isInt(depthRadius),
`Error in localResponseNormalization: depthRadius must be an integer
but got depthRadius ${depthRadius}.`);

let x4D = x as Tensor4D;
let reshapedTo4D = false;
Expand All @@ -58,7 +57,7 @@ export class LRNOps {
}
const res = ENV.engine.runKernel(
backend => backend.localResponseNormalization4D(
x4D, radius, bias, alpha, beta),
x4D, depthRadius, bias, alpha, beta),
{x4D});
if (reshapedTo4D) {
return res.as3D(res.shape[1], res.shape[2], res.shape[3]) as T;
Expand Down

0 comments on commit abcd97b

Please sign in to comment.