ArgMax operation or ArgMax reduction for LazyTensor
objects.
Arguments
- x
a
LazyTensor
or aComplexLazyTensor
.- index
a
character
corresponding to the wanted reduction dimension, either"i"
or"j"
, to specify whether if the argmax reduction is done along the indexi
orj
. It can beNA
(default) when no reduction is desired.
Value
a LazyTensor
if index = NA
or an array storing the result of
the specified argmax reduction otherwise.
Details
If x
is a LazyTensor
, argmax(x, index)
will :
if
index = "i"
, return the argmax reduction ofx
over thei
indexes.if
index = "j"
, return the argmax reduction ofx
over thej
indexes.if
index = NA
(default), return a newLazyTensor
object representing the symbolic argmax of the values along the inner dimension ofx
.
Note: Run browseVignettes("rkeops")
to access the vignettes and find
details about this function in the "RKeOps LazyTensor" vignette, at
section "Reductions".
Note: index
input argument cannot be NA
for the
argmax_reduction()
function.
Examples
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # creating LazyTensor from matrix x,
# indexed by 'i'
argmax_xi <- argmax(x_i, "i") # argmax reduction indexed by 'i'
argmax_x <- argmax(x_i) # symbolic matrix
}
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # creating LazyTensor from matrix x,
# indexed by 'i'
argmax_red <- argmax_reduction(x_i, "i") # argmax reduction indexed by 'i'
}