MaxPoolWithArgmax

public final class MaxPoolWithArgmax

Performs max pooling on the input and outputs both max values and indices.

The indices in `argmax` are flattened, so that a maximum value at position `[b, y, x, c]` becomes flattened index: `(y * width + x) * channels + c` if `include_batch_in_index` is False; `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True.

The indices returned are always in `[0, height) x [0, width)` before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.

Nested Classes

class MaxPoolWithArgmax.Options Optional attributes for MaxPoolWithArgmax  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

Output<U>
argmax()
4-D.
static <T extends TNumber, U extends TNumber> MaxPoolWithArgmax<T, U>
create(Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, Class<U> Targmax, String padding, Options... options)
Factory method to create a class wrapping a new MaxPoolWithArgmax operation.
static <T extends TNumber> MaxPoolWithArgmax<T, TInt64>
create(Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, String padding, Options... options)
Factory method to create a class wrapping a new MaxPoolWithArgmax operation using default output types.
static MaxPoolWithArgmax.Options
includeBatchInIndex(Boolean includeBatchInIndex)
Output<T>
output()
The max pooled output tensor.

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "MaxPoolWithArgmax"

Public Methods

public Output<U> argmax ()

4-D. The flattened indices of the max values chosen for each output.

public static MaxPoolWithArgmax<T, U> create (Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, Class<U> Targmax, String padding, Options... options)

Factory method to create a class wrapping a new MaxPoolWithArgmax operation.

Parameters
scope current scope
input 4-D with shape `[batch, height, width, channels]`. Input to pool over.
ksize The size of the window for each dimension of the input tensor.
strides The stride of the sliding window for each dimension of the input tensor.
padding The type of padding algorithm to use.
options carries optional attributes values
Returns
  • a new instance of MaxPoolWithArgmax

public static MaxPoolWithArgmax<T, TInt64> create (Scope scope, Operand<T> input, List<Long> ksize, List<Long> strides, String padding, Options... options)

Factory method to create a class wrapping a new MaxPoolWithArgmax operation using default output types.

Parameters
scope current scope
input 4-D with shape `[batch, height, width, channels]`. Input to pool over.
ksize The size of the window for each dimension of the input tensor.
strides The stride of the sliding window for each dimension of the input tensor.
padding The type of padding algorithm to use.
options carries optional attributes values
Returns
  • a new instance of MaxPoolWithArgmax

public static MaxPoolWithArgmax.Options includeBatchInIndex (Boolean includeBatchInIndex)

Parameters
includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`.

public Output<T> output ()

The max pooled output tensor.