张量的对数函数

怎么计算一个张量的对数或指数函数,假设一个张量A,如何计算exp(A)和log(A)。注意我的意思不是对元素计算。

TensorFlow里有张量函数,试试这个:

计算TensorFlow的自然对数

张量的exp数学上是如何定义的?我只能找到矩阵的。

这个是矩阵或者元素吧。和Julia的exp没区别。

你说的对。我看了下文档,直接用Julia的exp就可以啦。文档里写的就是张量指数函数的定义:
help?> exp
search: exp exp2 Expr expm1 exp10 export exponent expanduser ExponentialBackOff ldexp frexp nextpow nextprod macroexpand

exp(x)

Compute the natural base exponential of x, in other words e^x.

Examples
≡≡≡≡≡≡≡≡≡≡

julia> exp(1.0)
2.718281828459045

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

exp(A::AbstractMatrix)

Compute the matrix exponential of A, defined by

e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}.

For symmetric or Hermitian A, an eigendecomposition (eigen) is used, otherwise the scaling and squaring algorithm (see [^H05])
is chosen.

│ [^H05]

│ Nicholas J. Higham, “The squaring and scaling method for the matrix exponential revisited”, SIAM Journal on Matrix
│ Analysis and Applications, 26(4), 2005, 1179-1193. doi:10.1137/090768539 (https://doi.org/10.1137/090768539)

Examples
≡≡≡≡≡≡≡≡≡≡

julia> A = Matrix(1.0I, 2, 2)
2×2 Array{Float64,2}:
1.0 0.0
0.0 1.0

julia> exp(A)
2×2 Array{Float64,2}:
2.71828 0.0
0.0 2.71828

这个是矩阵的exp啊。虽然说矩阵算是二阶张量,但是一般也不这么叫吧。

如果是更高阶的张量,可能需要额外的包。我搜了下:
(v1.2) pkg> add Tensor
TensorCore TensorPolynomialBases TensorCast Tensors TensorOperations
TensorBoardLogger TensorKitManifolds TensorDecompositions TensorFlow
TensorKit TensorValues TensorNetworkAD TensorToolbox
不知道有没有满足任意阶张量运算的。

exp的帮助文档里给出的这个表达式:
e^A = \sum_{n=0}^{\infty} \frac{A^n}{n!}
其实也是任意阶张量指数函数的定义。
但很可惜,目前exp只能计算二阶张量,没有延伸到更高阶。

这个定义里 A^n 在高阶张量上是怎么定义的?有相关的文献么?

我错了。我查阅了黄克智院士写的《张量分析》。书中只定义了二阶张量的幂、多项式和解析函数。对于更高阶张量,书中没有给出幂的定义,更别提多项式和解析函数了。尽管我个人觉得任意阶张量的幂可以理解为连续的点积,但书里既然没写,那我就不能口胡了。即使任意阶张量的幂存在定义,也无法据此定义多项式和解析函数,因为显然不同幂次的阶数不匹配。