Description Details Usage Examples
This is a list of functions (mostly from base R) that are currently implemented to transform greta arrays. Also see operators and transforms.
TensorFlow only enables rounding to integers, so round()
will
error if digits
is set to anything other than 0
.
Any additional arguments to chol()
, chol2inv
, and
solve()
will be ignored, see the TensorFlow documentation for
details of these routines.
sweep()
only works on two-dimensional greta arrays (so MARGIN
can only be either 1 or 2), and only for subtraction, addition, division
and multiplication.
tapply()
works on column vectors (2D greta arrays with one column),
and INDEX
cannot be a greta array. Currently five functions are
available, and arguments passed to ... are ignored.
cospi()
, sinpi()
, and tanpi()
do not use the
computationally more stable routines to compute cos(x * pi)
etc.
that are available in R under some operating systems. Similarly
trigamma()
uses TensorFlow's polygamma function, resulting in lower
precision than R's equivalent.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | # logarithms and exponentials
log(x)
exp(x)
log1p(x)
expm1(x)
# miscellaneous mathematics
abs(x)
mean(x)
sqrt(x)
sign(x)
# rounding of numbers
ceiling(x)
floor(x)
round(x, digits = 0)
# trigonometry
cos(x)
sin(x)
tan(x)
acos(x)
asin(x)
atan(x)
cosh(x)
sinh(x)
tanh(x)
acosh(x)
asinh(x)
atanh(x)
cospi(x)
sinpi(x)
tanpi(x)
# special mathematical functions
lgamma(x)
digamma(x)
trigamma(x)
choose(n, k)
lchoose(n, k)
# matrix operations
t(x)
chol(x, ...)
chol2inv(x, ...)
cov2cor(V)
solve(a, b, ...)
kronecker(X, Y, FUN = c('*', '/', '+', '-'))
# reducing operations
sum(..., na.rm = TRUE)
prod(..., na.rm = TRUE)
min(..., na.rm = TRUE)
max(..., na.rm = TRUE)
# cumulative operations
cumsum(x)
cumprod(x)
cummax(x)
cummin(x)
# solve an upper or lower triangular system
backsolve(r, x, k = ncol(r), upper.tri = TRUE,
transpose = FALSE)
forwardsolve(l, x, k = ncol(l), upper.tri = FALSE,
transpose = FALSE)
# miscellaneous operations
aperm(x, perm)
apply(x, MARGIN, FUN = c("sum", "max", "mean", "min",
"prod", "cumsum", "cumprod"))
sweep(x, MARGIN, STATS, FUN = c('-', '+', '/', '*'))
tapply(X, INDEX, FUN = c("sum", "max", "mean", "min", "prod"), ...)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.