 argmax - Maple Help

DeepLearning,Tensor,argmax

find index with maximal value over entries of a Tensor

DeepLearning,Tensor,argmin

find index with minimal value over entries of a Tensor Calling Sequence argmax(t,opts) argmin(t,opts) Parameters

 t - Tensor opts - options, as specified below Options

 • axis=list(integer) or integer

The value of option axis is an integer or list of integers which describes which axis of the input Tensor to reduce across.

 • datatype=integer or integer

The value of option datatype specifies the type of data this Tensor will hold. The default is integer.

 • name=string

The value of option name specifies an optional name for this Tensor, to be displayed in output and when visualizing the dataflow graph. Description

 • The argmax(t) command returns the index with the largest value across the axes of a Tensor.
 • The argmin(t) command behaves similarly but returns the index with the smallest value across the axes of a Tensor.
 • The index returns by argmax and argmin is zero-based. Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $t≔\mathrm{Constant}\left(\left[0,7,2,9,3,6,8\right]\right):$
 > $\mathrm{argmax}\left(t,\mathrm{axis}=0\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[\right]}}\\ {\mathrm{Data Type: integer\left[8\right]}}\end{array}\right]$ (1)
 > $\mathrm{argmin}\left(t,\mathrm{axis}=0\right)$
 $\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Shape: \left[\right]}}\\ {\mathrm{Data Type: integer\left[8\right]}}\end{array}\right]$ (2) Compatibility

 • The DeepLearning,Tensor,argmax and DeepLearning,Tensor,argmin commands were introduced in Maple 2018.